Forum Discussion
Mic1979
1 year agoPost Partisan
Multiply two columns based on column header name
Dear all, I need to multiply two columns based on the Header Name: Column1 contains % Column2 contains € The code I used is this: Result = Table.AddColumn ( RemoveDuplicate, "Result",...
Mic1979
1 year agoPost Partisan
Can I ask you some question to understand the logic behind your code?
I am not familiar with this structure.
Thanks.
- dufoq31 year agoCommunity Champion
Of course, go ahead. Which part do you need to explain?
- Mic19791 year agoPost Partisan
Please let me study this a little bit, I would like to make the right questions and not waste your time.
Thanks a lot!!
- Mic19791 year agoPost Partisan
Hello dufoq3,
first question:
- what is the target for this part: b = Expression.Evaluate(Text.Combine(List.Transform(a, (x)=> Number.ToText(x, "G", "en-US")), "*"))
Thanks
- dufoq31 year agoCommunity Champion
Hi Mic,
result of a is list of number for selected columns (which contains % or € in the header)
List.Transform(a, (x)=> Number.ToText(x, "G", "en-US")) transforms list of numbers to list of text values with "." as decimal and no spaces or comma for thousands etc.
Text.Combine combines list into the text with delimiter "*"
Expression.Evaluate does the calculation based on text. Read this.