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: 
TomBond77
Specialist
Specialist

Accumulation with set analysis

Hi experts

I need to accumulate from month to month the FTE values. I have taken this formula:

above(sum({<[YearMonth]=
{"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"} >}
aggr(sum({<[YearMonth]=
{"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"} >}
distinct FTE),
[HashCode]
)
)

 

This seems to accumulate only the first row. How do I get the whole bunch of month (YTD) accumulated?

The table looks like this, without "above":

TomBond77_0-1702479469190.png

 

Thanks, Tom
)

 

2 Replies
TomBond77
Specialist
Specialist
Author

I got it:

rangesum(above(sum({<[YearMonth]=
{"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"} >}
aggr(sum({<[YearMonth]=
{"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"} >}
distinct ActiveFTE),[HashCode])), 0,RowNo()))

Here is the result:

TomBond77_0-1702481977241.png

 

But now I need to calculate the average over the month:

TomBond77_1-1702482015277.png

 

What do I need to add extra to get the average?

marcus_sommer

You could try to wrap your accumulation with another one, like:

rangeavg(above(rangesum(above(YourExpression))))

Another approach could be just to divide your accumulation-results with the month-num, like:

rangesum(above(YourExpression)) / MonthNum