I have an excel with 3 columns they are having YES or NO values based on these values i need to create a new column with confidence high low medium . like for example
column 1 column 2 colum 3 confidence
yes yes yes high
yes no no low
yes no yes medium
Use the Add Data Column activity to add a new column to the datatable.
i need expression to set high low medium how do i write that union expression
i know i can achieve this task by writing if clause but is there any other way to do it
You can use several If activities after you’ve added the confidence column
The conditions would be written as below
Row(0).ToString = "yes" AndAlso Row(1).ToString = "yes" AndAlso Row(2).ToString = "yes"
Row(0).ToString = "yes" AndAlso Row(1).ToString = "no" AndAlso Row(2).ToString = "no"
Row(0).ToString = "yes" AndAlso Row(1).ToString = "no" AndAlso Row(2).ToString = "yes"
Lets assume the table has fixed answer columns as above.
With these mininal steps it can be done
- we create an array with the rating codes
- iterate over all rows
row.ItemArray.Take(3).Count(Function (x) x.toString.Trim.ToLower.Equals("yes"))
- take the first 3 columns and count the occurence of yes
- take the count as an index and retrive the rating code
- update the row
with this approach:
- we are independed where the yes is marked (If we are restricted on position, then the flow can easy adopted as well)
- we are prepared for the no rating case or leave the code just empty
Find demo XAML here
Nagisetty_Leela_Kanthi.xaml (9.0 KB)