where WR SD OP and XX are the last words in the column name and if column contains any value other than 0 then it should be inserted in Remark column accordingly in the format shown and string matching is done after that.
Can anyone help in achieving the remark situation in this…
If they’re constant, you can simply hardcode the 4 values representing each column.
If they’re dynamic, however, then you may have to use either regular expressions or something like: columnName.substring(lastIndexOf(CChar("-") + 1), 2)
The lastIndexOf method will find the second hyphen in the column name and the substring method will then extract the next two letters.
Is there any specific part that you need help with or are you looking for someone to give you the whole solution?
Let’s define a dictionary with the column index and the Code like following for the first and second set:
Within a for each row we can collect the values by using the dictionaries Keys and Column Index and the dictionary values as code if value is not null and other as 0
e.g. Set1
with the help of a String Join we can bring into the requested format
For the Match column we can make benefit from the SequenceEquals Method:
Kindly note:
for some transparency reasons / quick prototyping reasons the dicts are configured within a datatable:
using this statement for its creation
for the start we did not setup a fully dynamic self configuring approach and assume that it is also not needed.