Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Use a variable and dollar sign expansion in the set analysis with single quotes. Check attached .qvw.
Regards, Sander
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
Use a variable and dollar sign expansion in the set analysis with single quotes. Check attached .qvw.
Regards, Sander
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.