Forum Discussion
apoje
Helper II
5 years agoHow to replace one item with a different one – apply transformation?
Hi, I would like to transform one of my items in the database based on its variation number. The end result would be a transformation of the variation number and multiplication of its quantity c...
- 5 years ago
Hi, apoje
Try this, for 100,000 lines please wait about 20 seconds to upload to excel.
let Source = Excel.CurrentWorkbook(){[Name="Table25"]}[Content], Custom1 = Table.FromRecords(List.Transform(Table.ToRecords(Source),each if [Variation.Number]="0527" then _&[Variation.Number=1999]&[Quantity=[Quantity]*10] else _)) in Custom1
shaowu459
Resolver II
5 years agoHi, apoje
Try this, for 100,000 lines please wait about 20 seconds to upload to excel.
let
Source = Excel.CurrentWorkbook(){[Name="Table25"]}[Content],
Custom1 = Table.FromRecords(List.Transform(Table.ToRecords(Source),each if [Variation.Number]="0527" then _&[Variation.Number=1999]&[Quantity=[Quantity]*10] else _))
in
Custom1
apoje
Helper II
5 years agoshaowu459 awesome! Do you know on the upper limit for lines of data to be still acceptable to use PQ?
- shaowu4595 years ago
Resolver II
I don't know the exact upper limit, But several million lines would not be problem. For large data, you may import and export from CSV, access, sql, etc.
- shaowu4595 years ago
Resolver II
This one is faster than the Record one.
let Source = Excel.CurrentWorkbook(){[Name="dataset"]}[Content], res = Table.ToList(Source,each if _{1}="0527" then {_{0},1999,_{2}*10} else _) in Table.FromRows(res,{"Order.ID","Variation.Number","Quantity"})