Hi,
I would like to know how I can count the amount of times a term appears in the rows of a DataTable. Say f.e.:
- Ben
- Stef
- Ben
- Rose
How could I make it return saying:
- Ben: 2
- Stef: 1
- Rose: 1
Any help would be appreciated!
Thanks in advance.
Hi,
I would like to know how I can count the amount of times a term appears in the rows of a DataTable. Say f.e.:
How could I make it return saying:
Any help would be appreciated!
Thanks in advance.
lets get returned a dictionary where key is the term and value is count
Assign activity:
dictLKTCount | Dictionary(of String, Int32) =
(From d in YourDataTableVar.asEnumerable
Group d by k=d(YourColNameOrIndex).toString.Trim into grp=Group
Select t = Tuple.Create(k, grp.Count)).ToDictionary(Function (x) x.Item1, Function (x) x.Item2)
Thanks for your reply!
Could you maybe visualise this in a Sequence? That would be a lot easier to understand!
Thank you
thats all we need
Just update the variable YourDataTableVar and the ColumnName or Index to your specifics
Thanks for your reply.
It returns âCannot assign from type System.Collections.Generic.Dictionary2[System.String.System.Int32] to type âSystem.Stringâ in the Assign activityâ however. How do I fix this?
you need to adapt the datatype
Do you have the full .net type so I can find it? I donât have it by default and canât seem to find it in my dependencies
Click then OK, OK
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.