Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different timeframes in expression

Hello,

I'm needing to calculate sum of account receivables of a month / avg of sales of previous 12 months.

I have to work at detailed level (I cannot pre-process cummulated averages).

Any clue ?

Thanks in advance

Cheers

1 Reply
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The "book answer" in ver. 8.5 is "Set Analysis".

Or, you can have a separate month field and link it to your AR months with a set of flags - SameMonthFlag, Last12MonthFlag, etc. Once you do that, you can use your new Month field as a Dimension in the chart and use your flags as multipliers in your expressions:

sum(AR_Amount * SameMonthFlag) / (sum(Sales * Last12MonthFlag) / 12)

cheers,

Oleg