Assign using IF statement help

I need to count each divisions in the “Performing Division” column. so in the screen shot there are 6 division 8000 and 25 or so division 6180. we only have 47 possible divisions. so i thought it would easiest to use a multiple assign with an IF statement to perform the count.

I’m i on the right track for the below IF statement code. i was thinking by placing this assign IF statement into a for each row will count each occurrence of performing division. any guidance on how to write this IF statement would be greatly appreciated

If(CurrentRow.row(“Performing Division”)=8000, Div8000+1,)

CurrentRow.row is wrong. And you have to output it as string then convert to integer to make a numeric comparison

If(CDbl(CurrentRow("Performing Division").ToString) = 8000, Div8000+1)

Is Div8000 a variable and is it an integer or double variable?

when it is about to have the counts from all Divisions then we can create with LINQ for us a LookUp Dictionary

Assign Activity
dictStatistic | DataType: Dictionary(Of String, int32) =

dtData.AsEnumerable.GroupBy(Function (x) x("Performing Division").toString.Trim).ToDictionary(function (x) x.Key, function (x) x.Count)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.