Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Rolling 52 weeks

Hello

I have trawled the internet for something to help me calculate the last rolling 52 weeks

My data will always show the current and last financial year I.e. Apr 2012  to  Current date onwards

I have an expression called variance which is calculating last financial years postion against current FY position

My load script will update monthly and what I want to show in my variance calculation is variance for the last rolling 52 weeks, are you able to help achieve this?

My expression is:

 

=

num((Count({<YEAR = {$(=Max(YEAR))}>}LOCAL_PATIENT_IDENTIFIER)-Count({<YEAR = {$(=Max(YEAR)-1)}>}LOCAL_PATIENT_IDENTIFIER)*100,'%')

In the script I also have written a week: Date(Weekstart([REFERRAL_DATE]), 'DD-MM-YYYY') AS OutPatients_Week

I just do not know where to start, can anyone help me achieve this please, or set me on my way

Kind Regards

Helen

1 Reply
shree909
Partner - Specialist II
Partner - Specialist II

Hi

try this

=

num((Count({<YEAR = { ">=$(=Max(YEAR)-1) <=$(=Max(YEAR))}>}LOCAL_PATIENT_IDENTIFIER))*100,'%') 

or

num((Count({<YEAR = { ">=$(=Max(YEAR)-1) <=$(=Max(YEAR))}>}LOCAL_PATIENT_IDENTIFIER))'#,##0%')

by using the above expression  You are taking the dates between current and previous year and calulting the count.