Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Hi all , i need your help regarding Qlik Sense Variables?

in the Load Script

I mentioned Variables like this

Let vmaxyear= 'max(Year)';
Let vpreyear='max(Year)-1';

so that in text object I wrote an expression  like this

=sum({$ <$(vmaxyear) >}Sales) and

another text object expression like this

  = sum({$ <$(vpreyear) >}Sales),

here I am getting same value for both the varaibles

Can you tell me how can I write an expression for

current year- previous year / previous year expression by using above variables