DR/CR Column contains = Dr and Cr string value
ABS=Sales
If (column(“DR/CR”) = “Dr”)
{column(“ABS”)}
else {0}
I want to separate the sales of Dr and Cr into 2 columns
DR/CR Column contains = Dr and Cr string value
ABS=Sales
If (column(“DR/CR”) = “Dr”)
{column(“ABS”)}
else {0}
I want to separate the sales of Dr and Cr into 2 columns
Hello @seanmanzanilla
Try by using ‘Pivoting’ node. Configured with [DR/CR] in Pivots and [ABS] in Manual aggregation aggregated by Sum or Mean… depending on data configuration an desired results (double check on expected results before validating your workflow)
BR
Hi @seanmanzanilla,
As @gonhaddock has said, the pivot node could be used to aggregate/summarize your debits and credits into two columns.
Alternatively, if your requirement is to simply include additional Debits and Credits columns to your existing data set you can also chain a pair of Rule Engine nodes:
becomes:
Or, you could leave out the TRUE => 0
line, in which case it would show missing values instead of zeroes where a value it is not applicable to each column.
split column.knwf (8.3 KB)
So it depends on your use case as to which method is appropriate, but I hope that helps.
Yes @takbb ,
I oversighted it on this comment, Pivoting will change the structure of the data, meanwhile your approach honors the initial structure.
It usually happens when the description of the challenged task is focused in the functionality without a context.
BR
Hi @gonhaddock , I think your approach and suggestions are perfectly valid and it’s always good to raise awareness of the pivoting and unpivoting nodes which can be an extremely powerful tool
I love your idea, i think it will work on my future project
This idea works for me thank you!