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
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
Sure bro,Im trying to do this with For each loop,getting error…
May I know the error you are facing
I want to perform same processing using loops…like the above