Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hrobertsonqv
Contributor II
Contributor II

Issue with getting same week, last year data in Set Analysis

I am trying to create a set analysis expression which will count the number of cases within a week from this year compared to the same week last year.  I have created Week_No in my calendar table (WeekName(RecordDate)), and I can work out the comparable Week_No from last year as

=WeekName(Week_No-364)

However, in set analysis, I am unable to work out how to add this as a modifier - the nearest I get is:

=count({$<Week_No={$(=WeekName(Week_No-364))}>} Distinct CaseID)

My results table using the above comes out as:

        

The data table is attached

Grateful for any help here

4 Replies
sunny_talwar

Try using this

Above(YourExpression4NoOfCaseThisYear)

hrobertsonqv
Contributor II
Contributor II
Author

I need to be able to see on each line the value for (eg) 2018/02 and the corresponding value for 2017/02

If I use 'Above', the value will be the figure for 2018/01 against the line for 2018/02, will it not?

sunny_talwar

My bad, you can do it do ways

1) Use The As-Of Table

2) Try with this Above(YourExpression4NoOfCaseThisYear, 12) but make sure you remove any set analysis related to restricting the data to show only 2018

hrobertsonqv
Contributor II
Contributor II
Author

Thanks - my problem might be the fact that I am using Dimensions which are date-based as well, so will have to re-think

Thanks anyway