Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sandy_Liu
Contributor
Contributor

Variables works in Label but not in Expression

Hi,

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)','%','$');

MtoM.GIF

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))))'

  • And in Expressoin:

=count({<
[a]={'xxxx'},
[b]={"*"},
[Initiated Month]={'$(=$(v_int_month))'}
>} distinct [ID])
-
(count({<
[a]={'xxxx'},
[b]={"*"},
[Initiated Month]={'$(=$(v_int_last_month))'}
>} distinct [ID]))

Do you know where is the probleme and how to solve it?

Thanks,

Sandy

 

Labels (2)
0 Replies