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

Calculating KPI where the definition changes for every month in straight table

Hello,

I am trying to calculate a forecast for an entire year and putting into a straight table.

The definition is as follows: If the month has passed, use the actual revenue and if the month is in the future, use the prognosis. Sum the prognosis and actual revenue together.

So for example in January 2014, there is no realised revenue for 2014, so for the forecast of 2014, we use the prognosis for every month.

In February there is one month of revenue and 11 months of prognosis which are added.

In December, one month of prognosis and 11 months of realized revenue are added.

I want to put this KPI in a straight table, looking something like this:

Jan-14     Feb-14 ...... Dec-14

   98          100               97

For a single month, I can do this quite easily, but I don't know how to put it into a straight table.

This is what I do to get the correct number for July in a text box:

=sum({<   Year={'2014'}, AMOUNT_TYPE={'Utfall'} , Month={'<7'} >} AMOUNT)/1000

+ sum({<   Year={'2014'}, AMOUNT_TYPE={'Prognos'} , Month={'>=7'} >} AMOUNT)/1000

Any ideas?

1 Reply
Not applicable
Author

Hello Henrik,

You have to use set analysis and combine two expressions and variables.

One for the real and the second for the prognos.

See exemple below

Hope it helps !