Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
marcus_steggall
Creator
Creator

Multiple IF statement, with Set Analysis

Hi team,

If I was producing a calculation in line one below, that works perfectly when selecting 2017.

Say I wanted to add a second line into the calculation, based on another year how would this work?

This one below, doesn't work for me

=SUM({<Year_YYYY={'$(vMaxYear)'},Period_P=,Period_Start={"<=$(vMaxDate)"}>} if(Year_YYYY='2017' ,Revenue*1.09))
OR
SUM({<Year_YYYY={'$(vMaxYear)'},Period_P=,Period_Start={"<=$(vMaxDate)"}>} if(Year_YYYY='2018' ,Revenue*1.07))

Cheers for your advice

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

May be try this

=Sum({<Year_YYYY={'$(vMaxYear)'}, Period_P, Period_Start = {"<=$(vMaxDate)"}>}
Revenue *
Pick(Match(Year_YYYY, '2017', '2018') , 1.09, 1.07)
)

View solution in original post

2 Replies
sunny_talwar

May be try this

=Sum({<Year_YYYY={'$(vMaxYear)'}, Period_P, Period_Start = {"<=$(vMaxDate)"}>}
Revenue *
Pick(Match(Year_YYYY, '2017', '2018') , 1.09, 1.07)
)
marcus_steggall
Creator
Creator
Author

ahh genious, I like that way

very helpful Sunny, appreciate your help

have a great weekend