How to compare row of same column

Hi all
Please suggest how to make a workflow to compare two row of same column.
If row of column are same than add corresponding value of other column and no of occurrence of same row.

1 Like

Sorry can you be bit clearer mate, might just be me but I can’t understand what you want?

hi i want to make a work flow for below mentioned task

@Palaniyappan can you please help me to solve above task. It would be a great help…

Hi @Deep_Kumar,
Can you explain it with the example .

Regards
Jyotika

did you reach a solution @Deep_Kumar,

@Jyotika_Halai I haven’t found any solution till now.
Please help me, if you can…

@Deep_Kumar,

Can you please explain the task with example?

Please check above link

@Deep_Kumar i am working on something that might help you. However , i need to understand from where you got the 75 and the 150. the 36 if occurred 2 times don’t sum up to 75. Same goes for the 60 that was repeated 4 times.
Please elaborate so i can help you more.
Waiting for your quick response.
Thanks

Hi @mozahra
As you can see there are two tables in the image, one is input and another is output.

In the input table there are case numbers A1, A2 ,A3,A4,A4,A5,A5,A6,A6,A6,A6 with its corresponding values in numbers.

We have to create an output table which will shows us sum of same case number and occurrence of that case.
Like if A1 comes one time in the input table then output will be
sum = 20 ( corresponding value) and occurrence= 1time
Like if A4 comes twice in the input table then output will be
Sum =35+ 35 = 70 occurrence = 2 times
Like if A6 comes four time in the input table then output will be
Sum = 60 +30+40+20 = 150
Occurrence= 4 times

Basically we have to create an output table from a given input table.
I hope you will help me.
Thanks
Deep_kumar

1 Like

Hi,
Create new dt with the column you want.
You can use
UniqueCaseDt= dt.defaultview.totable(true,“case no”)
It return unique entry like a1 a2 a3 a4…

Use for each row in Unique casedt
{
Newdt = dt.select("[Case No] = row(0).tostrig")–it give all duplicate record ex. For A4 it give 2 record in dt
Count = newdt.row.count — give occurrence
Again use for each row1 in newdt — use for getting sum value
Var sum =sum + row1(1).tostring — default val is 0
}

After that u can add all this val in row(add row in newly created dt)

I dont have desktop to check this but it works.

1 Like

@TUSHAR_DIWASE
I will try this and let you know.

Thanks for the valuable reply.
Deep

Sure. Let me know …or provide me sample file so that i can create the wf

Hello @TUSHAR_DIWASE and @Deep_Kumar.
I tried @TUSHAR_DIWASE approach and it worked. However. the .Select will return a datatRow instead so i used filterDataTable. Additionally the Sum should be declared with value 0 in the first for each loop and the summation should happen after the second for each loop.
2LoopThroughrowsofsamecolumnoption2.xaml (13.9 KB)
Thanks