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: 
Not applicable

Year To Date Question

Hi

I have a simple calculation like this (count(P2_skär) + count (P2_tryck)) and i present the answer in a guage chart.

It works fine when i choose a specific month or months but it's not the sum i want.

I would like the chart to show me the answer divided by the number of months this year (average for year to date).

Is this possible?

/Mats

2 Replies
datanibbler
Champion
Champion

Hi Mats,

very few things are generally not possible.

To get a YTD status, you will have to

- use a set_analysis_expression with the {1} to ignore all user_selections

   <=> but in that same expression, set a filter for the current year

=> Keep in mind that to use set_expression, you always need some aggregation_function. Avg() would seem a good idea to get the YTD_average (there are limitations, Henric Cronstroem has written about that, but I think that for the "rest of us", the traditional average is good enough)

HTH

Best regards,

DataNibbler

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Mats,

This example document shows how year to date can be calculated:

QlikView App: Simple Year To Date Example (Set Analysis)

You could then simply divide by the max month variable to give you the average over months to date.

Hope that helps,

Steve