Hi ,
I’m extract the data from data scrapping now i want to have count of duplicate name. Please share your view below is the example:-
ID | Name |
---|---|
1 | AA |
2 | AA |
3 | AA |
4 | |
5 | |
Now i need the count of AA and QQ separately. |
Hi ,
I’m extract the data from data scrapping now i want to have count of duplicate name. Please share your view below is the example:-
ID | Name |
---|---|
1 | AA |
2 | AA |
3 | AA |
4 | |
5 | |
Now i need the count of AA and QQ separately. |
Hello @Dany069
you can try this
Dim name as integer
For each row As DataRow In "dt_ScrappingOutput’
name = row(“Name”).tostring.count
next row
Or if you have the value in a variable of type string, try this:
dim count as integer = yourString.count
Hi @Dany069
These two should work:
yourDataTable.Select("[Name]='AA'").Count
and
yourDataTable.Select("[Name]='QQ'").Count
These queries will count the occurrences of either AA
or QQ
. To get the count of just the duplicates, you can subtract 1 from the query result
Hi,
I have used but giving error because the column name in array do i need to convert this into string row.item(columnname).
Could you post a screenshot of the exact error and of your workflow?
Please find the attached screenshot
Thank you. Could you add to that a screenshort of the the full syntax in your workflow?
This expression can be used in an Assign activity and not in a loop. For example, try this in a Log Message activity:
yourDataTable.Select("[Name]='QQ'").Count.ToString
It should print the count into the console
Hi
you can use the group by aggregation activity in the below one.
Regards
Balamurugan.S
hi there, what will the syntax be if we are trying to get a count of a certain string rather than an exact match? for eg. in above scenario, if values are ‘AA’ or ‘QQ’, we will get the count. What if we even want the count of AA if it is part of a string (eg.‘AABB’)?
Thanks in advance
Hi @mchadha
Please see this comment
@loginerror - thank you so much for the quick response. Works fine now
Trying to implement this, but the Select is not working or should I say, always returns a Count of 0 (zero)…? Any ideas as to why?
Try outputting the underlying data table to your Output panel (Output Data Table activity) or simply save it into Excel. This should give you a clue on what is going wrong there.