locked
How do i expand the value when it comes in as List RRS feed

  • Question

  • I'm not 100% there yet with M .  But i'm trying to get a Table to expand when a certain condition is met.  The last line does this but it comes in as a "List" link in green and I want it to just expand that list value for each List value in the column.  What do I need to add to the code to get that to show the value.  

    let
        Source = Xml.Tables(File.Contents("C:\Users\jeff\Desktop\VIA Media\Complicated IO Example.xml")),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "Styles" or [Name] = "Worksheet")),
        #"Expanded Table" = Table.ExpandTableColumn(#"Filtered Rows", "Table", {"Name", "Table"}, {"Table.Name", "Table.Table"}),
        #"Filtered Rows1" = Table.SelectRows(#"Expanded Table", each ([Table.Name] = "Style" or [Table.Name] = "Table")),
        #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows1",{"Table.Table"}),
        #"Expanded Table.Table" = Table.ExpandTableColumn(#"Removed Other Columns", "Table.Table", {"Table"}, {"Table.Table.Table"}),
        #"Expanded Table.Table.Table" = Table.ExpandTableColumn(#"Expanded Table.Table", "Table.Table.Table", {"Name", "Table", "Cell", "urn:schemas-microsoft-com:office:spreadsheet"}, {"Table.Table.Table.Name", "Table.Table.Table.Table", "Table.Table.Table.Cell", "Table.Table.Table.urn:schemas-microsoft-com:office:spreadsheet"}),
        #"Expanded Table.Table.Table.Cell" = Table.ExpandTableColumn(#"Expanded Table.Table.Table", "Table.Table.Table.Cell", {"Data", "urn:schemas-microsoft-com:office:spreadsheet"}, {"Table.Table.Table.Cell.Data", "Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet"}),
        #"Expanded Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet" = Table.ExpandTableColumn(#"Expanded Table.Table.Table.Cell", "Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet", {"Attribute:MergeAcross", "Attribute:StyleID"}, {"Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet.Attribute:Me", "Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet.Attribute:St"}),
        #"Removed Other Columns1" = Table.SelectColumns(#"Expanded Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet",{"Table.Table.Table.Cell.Data", "Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet.Attribute:Me", "Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet.Attribute:St"}),
        #"Removed Errors" = Table.RemoveRowsWithErrors(#"Removed Other Columns1", {"Table.Table.Table.Cell.Data"}),
        #"Added Custom" = Table.AddColumn(#"Removed Errors", "Custom", each if Text.Length([#"Table.Table.Table.Cell.urn:schemas-microsoft-com:office:spreadsheet.Attribute:St"]) > 3 then [Table.Table.Table.Cell.Data][#"Element:Text"] else "null"),

    Friday, August 17, 2018 7:06 PM

Answers