I've created 2 variables( v_int_month+v_int_last_month) in scripts to get the month M and month M-1:
set v_int_month= if (%(v_t_f_selection_on_int) = 0,num(Monthname(Max(Date([Date Initiated],'YYYY/MM/DD')))),num('Initiated Month')); Let v_int_month = Replace('$(v_int_month)','%','$');
set v_int_last_month=if (%(v_t_f_selection_on_int) = 0,num(Monthname(Max(Date([Date Initiated],'YYYY/MM/DD')),-12)),num(Monthname('Initiated Month',-12))); Let v_int_last_month = Replace('$(v_int_last_month)','%','$');
When I applied it to the set analysis, the v_int_last_month works in Lable but NOT in Expression:
Here's my set analysis in Lable:
='MtoM'&' '&'($(=Monthname($(=v_int_month)))'&' vs '&'$(=Monthname($(=v_int_last_month))))'