Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

krishna20
Valued Contributor

Set Analysis

Hi,

I'm having data from 1995 to 2007 only. I need to show the 2007 data as current year and Previous Year as 2006.

I created a variable in Load Script as

SET VCurrentYear=Year(Today());

I used this variable in set analysis.I'm not getting the data .I don't know where i went wrong.

Num(Sum({<[Payroll year]={$(=vCurrentYear)-8}>}RESULT_VALUE),'#,###.00')

I checked $(VCurrentYear)-8 in the Text Object it's showing the year as 2007. But in set analysis its not working.

Can anyone please suggest me.

Regards

krishna

1 Solution

Accepted Solutions
MVP
MVP

Re: Set Analysis

If this worked for you in a text box object -> $(VCurrentYear) - 8 (Gave you 2007), then this should work:

Sum({<[Payroll year]={"$(=$(VCurrentYear)-8)"}>}RESULT_VALUE)

13 Replies
MVP
MVP

Re: Set Analysis

See if this works:

=Num(Sum({<[Payroll year]={$(vCurrentYear)-8}>}RESULT_VALUE),'#,###.00')


=Num(Sum({<[Payroll year]={$(VCurrentYear)-8}>}RESULT_VALUE),'#,###.00')

gautik92
Valued Contributor III

Re: Set Analysis

create a variable vYear with value 1 and create a input box with that variable add the variabel in set analysis and see

Num(Sum({<[Payroll year]={$(=max([Payroll year]))-vYear}>}RESULT_VALUE),'#,###.00')

krishna20
Valued Contributor

Re: Set Analysis

Hi Sunny,

No it's not working. The text object is showing empty.

MVP
MVP

Re: Set Analysis

Try :

Num(Sum({<[Payroll year]={$(=$(vCurrentYear)-8)}>}RESULT_VALUE),'#,###.00')

MVP
MVP

Re: Set Analysis

What about this:

=Num(Sum({<[Payroll year]={"$(VCurrentYear)-8"}>}RESULT_VALUE),'#,###.00')

sasiparupudi1
Honored Contributor III

Re: Set Analysis

Num(Sum({<[Payroll year]={"$(vCurrentYear)-8"}>}RESULT_VALUE),'#,###.00')

krishna20
Valued Contributor

Re: Set Analysis

Hi,

I Think there is no input box in Qliksense.

krishna20
Valued Contributor

Re: Set Analysis

Hi Tresesco,

No Luck. It's not working.


Hi Sasidhar,

Your Expression result is zero.

MVP
MVP

Re: Set Analysis

First thing first -> Is your variable named vCurrentYear or VCurrentYear?