Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marakud971
Contributor III
Contributor III

Calculate a value over different periods

Good morning all,

I need help to perform a calculation.

I would like to calculate the number of contracts at the end of the period - max (date) - in dimension and compare it with the same period of the previous year.

Currently, I have a graph for each period (customer request): Year, Semester, quarters, Month, Week, Dayss.
If I select the year 2020, I will automatically have the data of the years, Semetres, quarters, months, weeks and days of the years 2019 and 2020.

My calculation for the current period is:
SUM ({<DATE_CODE = {$ (vEndFilterDate)}>} CONTRACT_COUNT)

with

vEndFilterDate = max (DATE_CODE)

it seems to me to work when I change year, month and the others for  2020.

Each time I have to find the max date of the period and calculate the number of contracts on that date.

But I cannot automate the calculation for the periods of the previous year.

How to do this ?

Thank you a lot

2 Replies
Brett_Bleess
Former Employee
Former Employee

Have a look at the following Design Blog posts, hopefully one of them will help on this:

https://community.qlik.com/t5/Qlik-Design-Blog/Dates-in-Set-Analysis/ba-p/1472511

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

Here is the base URL in case you want to search further on your own as there are some further Set Analysis posts, but the two above were most applicable I think.

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Saravanan_Desingh

Please share the sample data and expected output to help in this.