I have an excel list with two columns, one containing the customer, the other whether the customer receives a newsletter.
I would now like to find out how many customers receive a newsletter, so I would like to count how often there is a yes in the Newsletter column.
Can someone explain how it works?
Fine to know the count of customer with newsletter as Yes then once after reading the data from excel with read range saving it in a datatable named dt
Use a assign activity like this int_count = dt.AsEnumerable().Select(Function(a) a.Field(of String)(“Newsletter”).ToString.ToUpper.Equals(“YES”)).Count
This will give us count value to a int32 variable named int_count
@RoboticApprentice Can you Check this Statement : int_count = dt.AsEnumerable().Select(Function(a) a.Field(of String)(“Newsletter”).ToString.ToUpper.Equals(“YES”)).ToArray.Count
@RoboticApprentice That Depends on the Values , Hence Try this Code int_count = dt.AsEnumerable().Select(Function(a) a(“Newsletter”).ToString.ToUpper.Trim.Equals(“YES”)).ToArray.Count
Also if it doesn’t work, Is it Possible to Show us Your Excel File ?