Forum Discussion
Replace Value using a value in different column in PowerQ
- 6 years ago
Hello PowerQPro
your code should look something like this. I just replaced my datasoure with your steps till the transformation.
let let FullPathToFile2 = Excel.CurrentWorkbook(){[Name="FilePath2"]}[Content]{0}[Column1], Source = Csv.Document(File.Contents(FullPathToFile2),[Delimiter="#(tab)", Columns=29, Encoding=65001, QuoteStyle=QuoteStyle.None]), #"Removed Top Rows" = Table.Skip(Source,13), #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]), #"Removed Top Rows1" = Table.Skip(#"Promoted Headers",2), TransformRows = Table.FromRecords(Table.TransformRows ( #"Removed Top Rows1", (row)=> let check3Fill4 = if row[_3]<> "" then Record.TransformFields(row, {"_4", each "----"}) else row, check4Fill4 = if check3Fill4[_4]<> "" then Record.TransformFields(check3Fill4, {"_5", each "----"}) else check3Fill4 in check4Fill4 )) in TransformRowsyou have to update this part according you needs. These two lines should show how to get there
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hi PowerQPro ,
It seems that you want to simplify this in one step, right? But in your scenario, these steps will refer to previous step, so I think it is hard to complete it in a simple step.
Or you also could @ super users in this forum for more suggestions.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.