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

Cyclic group with 3 month moving/rolling average

Hi, the 3 month rolling average formula in my chart is:

num(rangeavg(above(sum({<MatchingsMonth=,MatchingsDate=>}

Revenue),0,3)),'#,##0')

I have month and week as a cyclic group in the chart dimension. When I switch to week, I'd need the formula to change to

num(rangeavg(above(sum({<MatchingsMonth=,MatchingsDate=>}

Revenue),0,12)),'#,##0')

How can I automatically change the formula when switching from month to week? Thanks.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

If(GetCurrentField(GroupName)='week', <this formula>, <that formula>)

View solution in original post

3 Replies
tresesco
MVP
MVP

Try like:

If(GetCurrentField(GroupName)='week', <this formula>, <that formula>)

sifatnabil
Specialist
Specialist
Author

Thanks. Just FYI it seems to only work with double quotes, i.e. GetCurrentField("GroupName")

tresesco
MVP
MVP

If there is space in between your group name, then only double quotes or squre brackets would be required. Learn about it here: quoteology