Basically I have a table similar to the below:
Dept…Jul…Aug…Sep
AA1…201…309…460
BB2…202…360…520
CC3…302…402…650
I need to be able to select the correct 3 digit number from the excel/DT based on a variable that holds the Dept and Another Variable that holds today’s date, so as each month goes by it then auto-selects the next columns figures.
At present I have read the excel into a DT, filtered it using DTJobNo.AsEnumerable.Where(Function(x)x(“Dept“).tostring.equals(DeptVariable)).toArray
I am able to then select each of the “columns” through the i.e. Array.items(1) assign activity. But was hoping for something a little slicker than using lots of IFs to assign the variable based on the month.
I’ve got it to work, but its a bit too clunky for my liking and would require some updating of the process to ensure it works long term, so would welcome any and all suggestions to make this more robust long term.
Thanks in advance
Dawn