Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tross4012
Helper I
Helper I

How to apply applied steps to each record in a table

Hey everyone,

 

I'm running into some issues with the current query I have and was hoping that someone might be able to point me in the right direction. As you can see in the picture 1, I am passing a value ("Column1") into the "URL" column. This URL gets the data from the api and loads the results into the "Record" column. 

1.tross4012_0-1689616268020.png

Originally, I thought that if I clean the data for the "Table" in any one of these rows that it would apply all other tables in the "Record" column but it appears that the applied steps you'll see below only apply to the first table/record on the list. 

2.tross4012_1-1689616467507.png

 

How can I iterate through the "Record" column (picture 1) and apply the same applied steps (picture 2) to each record? 

1 ACCEPTED SOLUTION
baghdadi62
Resolver III
Resolver III

Hi,

You need to create a custom column and formulate the expressions as per your specific requirements for the created tables (Record column). The choice of the formula depends on your objective. Please state your needs, and I might be able to assist you.

View solution in original post

2 REPLIES 2
tross4012
Helper I
Helper I

Hey Baghdadi,

 

I need to have each of the values in the "Record" column subjected to the following steps:

  1. #"Changed Type1" = Table.TransformColumnTypes(Record,{{" <FullStudy Rank=""1"">", type text}}),
  2. #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type1", " <FullStudy Rank=""1"">",
  3. Splitter.SplitTextByDelimiter(">", QuoteStyle.Csv), {" <FullStudy Rank=""1"">.1", " <FullStudy Rank=""1"">.2"}),
  4. #"Changed Type2" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{" <FullStudy Rank=""1"">.1", type text}, {" <FullStudy Rank=""1"">.2", type text}}),
  5. #"Split Column by Delimiter1" = Table.SplitColumn(#"Changed Type2", " <FullStudy Rank=""1"">.2", Splitter.SplitTextByDelimiter("<", QuoteStyle.Csv), {" <FullStudy Rank=""1"">.2.1", " <FullStudy Rank=""1"">.2.2"}),
  6. #"Changed Type3" = Table.TransformColumnTypes(#"Split Column by Delimiter1",{{" <FullStudy Rank=""1"">.2.1", type text}, {" <FullStudy Rank=""1"">.2.2", type text}}),
  7. #"Removed Columns" = Table.RemoveColumns(#"Changed Type3",{" <FullStudy Rank=""1"">.2.2"}),
  8. #"Added Index" = Table.AddIndexColumn(#"Removed Columns", "Index", 0, 1, Int64.Type),
  9. #"Inserted Trimmed Text" = Table.AddColumn(#"Added Index", "Trim", each Text.Trim([#" <FullStudy Rank=""1"">.1"]), type text),
  10. #"Reordered Columns" = Table.ReorderColumns(#"Inserted Trimmed Text",{" <FullStudy Rank=""1"">.1", "Trim", " <FullStudy Rank=""1"">.2.1", "Index"}),
  11. #"Removed Columns1" = Table.RemoveColumns(#"Reordered Columns",{" <FullStudy Rank=""1"">.1"}),
  12. #"Filtered Rows" = Table.SelectRows(#"Removed Columns1", each ([Trim] = "<Field Name=LocationCity" or [Trim] = "<Field Name=LocationCountry" or [Trim] = "<Field Name=LocationFacility" or [Trim] = "<Field Name=LocationState" or [Trim] = "<Field Name=LocationZip" or [Trim] = "<Field Name=NCTId")),
  13. #"Added Conditional Column" = Table.AddColumn(#"Filtered Rows", "Custom", each if [Trim] = "<Field Name=LocationFacility" then [Index] else null),
  14. #"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Custom"}),
  15. #"Removed Columns2" = Table.RemoveColumns(#"Filled Down",{"Index"}),
  16. #"Added Conditional Column1" = Table.AddColumn(#"Removed Columns2", "Headers", each if [Trim] = "<Field Name=NCTId" then "NCTId" else if [Trim] = "<Field Name=LocationFacility" then "Location Facility" else if [Trim] = "<Field Name=LocationCity" then "Location City" else if [Trim] = "<Field Name=LocationState" then "Location State" else if [Trim] = "<Field Name=LocationZip" then "Location Zip" else if [Trim] = "<Field Name=LocationCountry" then "Location Country" else null),
  17. #"Reordered Columns1" = Table.ReorderColumns(#"Added Conditional Column1",{"Trim", "Headers", " <FullStudy Rank=""1"">.2.1", "Custom"}),
  18. #"Removed Columns3" = Table.RemoveColumns(#"Reordered Columns1",{"Trim"}),
  19. #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns3",{{" <FullStudy Rank=""1"">.2.1", "Values"}}),
  20. #"Pivoted Column" = Table.Pivot(#"Renamed Columns1", List.Distinct(#"Renamed Columns1"[Headers]), "Headers", "Values"),
  21. #"Removed Columns4" = Table.RemoveColumns(#"Pivoted Column",{"Custom"})

 

The steps above clean and format the data associated with the "Table" in the "Record" column however, I need them to apply to each "Table" in each row, not just the first one. 

tross4012_0-1689684565732.png

 

baghdadi62
Resolver III
Resolver III

Hi,

You need to create a custom column and formulate the expressions as per your specific requirements for the created tables (Record column). The choice of the formula depends on your objective. Please state your needs, and I might be able to assist you.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors