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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
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.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

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

View solution in original post

3 Replies
tresB
Champion III
Champion III

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")

tresB
Champion III
Champion III

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