Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis Problem

Hi all,

I am having a spot of bother around a set analysis.

I have a line chart and want to display values as at the same time in the previous year.  However, my issue surrounds the selected variable.  For example, the selected variable (Trimester) displays as follows:  2012-2 (denoting 2012 as the year and 2 as the semester). I really don't want to split up the variable into 2 user selections/fields (Year and Semester) and run set analysis against these as it will add a layer of possible user error.

The code I am using is:

 

=COUNT({<Trimester={"$(LEFT(Trimester, 4)-1) & '-' & RIGHT(Trimester, 1)"}>}DISTINCT(PERSON_ID))

have also tried

=COUNT({<Trimester={"$(LEFT(Trimester, 4)-1) + '-' + RIGHT(Trimester, 1)"}>}DISTINCT(PERSON_ID))

and just plain

=COUNT({<Trimester={"$(LEFT(Trimester, 4)-1)"}>}DISTINCT(PERSON_ID))

Have tried variants of the above and have come up feeling rather empty and dejected.

Any suggestions would be welcome.

Thanks

Sample file attached.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Use a variable and dollar sign expansion in the set analysis with single quotes. Check attached .qvw.

Regards, Sander

View solution in original post

3 Replies
advait_thakur
Creator III
Creator III

Hello Karl,

  I have tried your Set with many different approaches. Strange that it still shows Last Year 0.

I turn your chart to straight table to see the values.

I also observe that you have kept Last Year expression at Full Accumulation.

The below expression displays data for Last year though its not the correct way.

COUNT({<Trimester={'2011-2'}>}DISTINCT(PERSON_ID))

Please let me know once you find more about this.

Thanks,

Advait

Join the official Qlik Enthusiast's page here
https://www.linkedin.com/groups/6513382/
Anonymous
Not applicable
Author

Use a variable and dollar sign expansion in the set analysis with single quotes. Check attached .qvw.

Regards, Sander

Anonymous
Not applicable
Author

Oh, and if you switch on full accumulation again for both expressions its cumulative again (open door). I switched this of to check if single values matched when changing the trimester. Regards.