Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I would like to create a visualisation in Qlik Sense that calculates the cumulative number of incidents for each year. What sounds simple at first, presents me with major challenges when developing a suitable key figure. The following criteria must be covered by the formula of the key figure:
Two tables are available as a database for this, which I have mimicked in the attached sample application. One table, ‘Calendar’, contains the relevant date fields, while the ‘Incidents’ table contains the unique IDs of the incidents.
So far I have tested the following formula:
RangeSum(Above(Count(IncidentID),0,RowNo()))
The result is already very close to the target - the only problem is that the calculation does not start from zero on 1 January each year. Addtionally, it is calculated dynamically in the case of date selections.
As a result, based on the sample data, I expect the chart to show 6 as the cumulative number of incidents for 31/12/2023, 0 as the cumulative number for 01/01/2024 and 8 as the cumulative number for 14/02/2024, for example.
I would be pleased if someone could help me. Many thanks in advance.
You can use the following expression to obtain the desired output:
Aggr(RangeSum(Above(count(IncidentID), 0, RowNo())), Year,[%Key_Date])
Hi @pallavi_96
It's me again. I've returned to work after the holidays and wanted to use your solution, which worked great with the sample data. Unfortunately, I ran into two major problems:
Can you please provide further support in the form of an adapted formula or an alternative approach? Or maybe someone else?
Thanks again in advance! Best regards.