Hello Team,
Im trying to get the count of P,A,H,Please guide
@Mayyur you can read the excel data sheet into using Read Range which will output a DataTable for you. Then you can use For Each Row activity to traverse thru DataTable and create a local variable counter/counters to increment every time you find an occurrence say. row(ācol1ā) equals āPā counter_P ++ else row(ācolā) equals āHā counter_H++.
Additionally, you might also consider using DataRow variable for each Row being traversed to check each element of DataRow for values P/A/H!!
Try the logic around and share your workflow, if stuck!!
I have around 30 columns,
iām trying to calculate count for each name and for every P,H,A related to name
Seems like attendance data !! Anyways, I would say - āconsider using DataRow[] variable for each row item being traversed and check with nested-if (guess 2 with be fine) element of DataRow for values P/A/H!!ā You would need to add another āFor Eachā activity for to traverse thru DataRow.
Can you please share a workflow similar to it for reference
,
Which activity it isā¦Thanks
its just a FOR EACH LOOP
with expression like this
same for all three but with different characters
int_PCount + row.ItemArray.ToList().AsEnumerable().Where(Function(a) a.ToString.Contains(āPā)).Count
CHeers @Mayyur
Yeah its working,but it is adding all P in both the rows,I want to separately count for each nameā¦Thank u
GOt itā¦Thank you
Thanks alot Palaniyappanā¦for being all time mentor as an when requiredā¦
@Palaniyappan expression you came up with is bang on !! " int_PCount + row.ItemArray.ToList().AsEnumerable().Where(Function(a) a.ToString.Contains(āPā)).Count"
Hey,Is there any other method of doing the same
This is more reliable and faster
Another method is using loop which might take more time
Thatās why suggested this buddy
And by the way kindly mark the right comment as solution that would help others looking for ideas under your topic
Cheers @Mayyur
Sure bro,Im trying to do this with For each loop,getting errorā¦
Error- System.Data.Datarow to System.Collection.Ienumerable
I want to perform same processing using loopsā¦like the above