Hi there, I currently have a datatable Table1 where I have columns
ID, Amt
ABC, 123
ABC, 123
TUV, 456
TPO, 0
TPO, 0
What I want to do is to extract only the duplicated rows where Amt does not equal to 0.
I currently have an assign activity for my output dt being Table 2 =
Table1.AsEnumerable.GroupBy(function(r) r(“ID”)).Where(function(r) r.Count() > 1).SelectMany(function(l) l).ToArray().CopyToDatatable
Current output
ID, Amt
ABC, 123
ABC, 123
TPO, 0
TPO, 0
This gives me a datatable with all duplicated rows inside (correct) - but how do I add the condition to the above to specify that only the columns whre Amt =/= 0 is brought over?
Desired Output
ID, Amt
ABC, 123
ABC, 123
Would appreciate someone’s help on how to modify my formula so I can extract the above. Thank you!
you can apply filter on Table 2, so you are only filtering on duplicate rows and you are not losing any original data.
You can use filter data table on Table 1 and save the output (filtered table) to a different data table (Dt_Temp). Then you can use the formula on DT_Temp (as DT_Temp is filtered it wont have 0s). So you have original data in Table 1 itself.