• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error in M between steps that can't find record ---- thanks

jutu

Member
I have expanded a table but forgot to add a field so i came back to the step with the Expanded table and just ticked the required field and added it.
STEP DESCRIPTION AS BELOW;
= Table.ExpandTableColumn(#"Filtered Rows1", "Semantic.DimMeterHistory", {"ZFreeDescriptor"}, {"Semantic.DimMeterHistory.ZFreeDescriptor"})


In the step below the above, it now gives me the error as attached that can't find the 'Semantic.CimMeterHistory.Status' record.
STEP DESCRIPTION IS;
= Table.SelectRows(#"Expanded Semantic.DimMeterHistory", each ([Semantic.DimMeterHistory.Status] <> 90))
 

Attachments

  • Error in M between steps.docx
    99.6 KB · Views: 4
why are you posting a picture in word for help in Excel. Cannot manipulate data in what you provided. Load your excel workbook so that we can work it.
 
Thank you for your reply. I could imagine that the previous step needs the status one. However, I have never used the M language and really don't know how to insert it in the correct way i the below step. I tried yesterday putting curly/square brackets and parenthesis in different positions and nothing seems to work.

I found a way in the end by simply taking notes of every step and just deleting all steps before the error, adding the Status field and then repeating all the steps, but if you can help to put the Status added field in the previous step in the right way I will be much appreciated. It will help to understand it in future so I don't have to delete all the steps and repeat all the transformations again.

STEP PREVIOUS TO BROKEN;
= Table.ExpandTableColumn(#"Filtered Rows1", "Semantic.DimMeterHistory", {"ZFreeDescriptor"}, {"Semantic.DimMeterHistory.ZFreeDescriptor"})
 
There are 4 arguments to that function:

= Table.ExpandTableColumn(
#"Filtered Rows1", <- This is the name of the step that has the column containing the table to expand (usually just the previous step)
"Semantic.DimMeterHistory", <- this is the name of the column in that step that has the table in each row
{"ZFreeDescriptor"}, <- this is the list of names of the columns you want to extract from the table, so this is the key bit to change
{"Semantic.DimMeterHistory.ZFreeDescriptor"} <- this is the list of new names for the columns (you obviously chose to use the table name as a prefix) This list must have the same number of items as the previous one if you supply it at all.
)

So, to include the Status column, you would add it to the list(s)

= Table.ExpandTableColumn(#"Filtered Rows1", "Semantic.DimMeterHistory", {"ZFreeDescriptor", "Status"}, {"Semantic.DimMeterHistory.ZFreeDescriptor", "Semantic.DimMeterHistory.Status"})

Does that make sense?
 
Hi. It's brilliant.
There are 4 arguments to that function:

= Table.ExpandTableColumn(
#"Filtered Rows1", <- This is the name of the step that has the column containing the table to expand (usually just the previous step)
"Semantic.DimMeterHistory", <- this is the name of the column in that step that has the table in each row
{"ZFreeDescriptor"}, <- this is the list of names of the columns you want to extract from the table, so this is the key bit to change
{"Semantic.DimMeterHistory.ZFreeDescriptor"} <- this is the list of new names for the columns (you obviously chose to use the table name as a prefix) This list must have the same number of items as the previous one if you supply it at all.
)

So, to include the Status column, you would add it to the list(s)

= Table.ExpandTableColumn(#"Filtered Rows1", "Semantic.DimMeterHistory", {"ZFreeDescriptor", "Status"}, {"Semantic.DimMeterHistory.ZFreeDescriptor", "Semantic.DimMeterHistory.Status"})

Does that make sense?
Hi. It's brilliant, thank you so much for taking the time to explain it so well and so thoroughly. It will surely help me next time that it gives me an error. Dealing with a variety of large tables can be very frustrating. Many thanks
 
Back
Top