Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Quarterly Sums by Month

I have a chart (straight table) that shows KPIs by month. However one of the KPIs is really a quarterly measure, I need help displaying this on the table.

There is a binary flag for each month of data and I need it sum by month over the quarter. For example:

Jan - 2

Feb - 3

Mar - 5

The chart would show: Jan - 2 | Feb - 5 | Mar - 10 |

Then start back at 0 for April... also when Mar is selected I would like to see 10 instead of 5.

Thanks!

3 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

It looks like you need to calculate a running total. If you want to do it in the script, use functions peek() and previous() to accumulate the running quarterly total for each of your data entities. There is a wiki page describing it:

http://community.qlik.com/wikis/qlikview-wiki/using-peek-and-previous-functions-recursively-to-help-...

(I think I quoted it 5 times in the last 2 days - seems to be a very popular topic)

Not applicable
Author

Sorry, but I don't see how to use this as an answer to my issue. I thought I could do it with a calculation rather than in the load...

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Depending on the size of your data, it may or may not be possible...

  • Since your chart requires monthly calculations, you can't use Set Analysis to determine Quarterly numbers.
  • In addition, each monthly row is only associated with data that pertains to the specific month, so the other months in the same quarter become "out of scope". To overcome this issue, you can use prefix TOTAL.

Actually, as I was typing, an interesting thought occurred to me... If you add Quarter as a hidden dimension to your Monthly chart, you can then use TOTAL <Quarter> to accumulate quarterly numbers:

sum( TOTAL <Quarter> MyValue)

The only requirement is that Quarter is one of the chart dimensions, even if it's hidden.