# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Contributor

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

• ### Set Analysis

1 Solution

Accepted Solutions MVP

## Re: Multiple IF statement, with Set Analysis

May be try this

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

## Re: Multiple IF statement, with Set Analysis

May be try this

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

## Re: Multiple IF statement, with Set Analysis

ahh genious, I like that way

very helpful Sunny, appreciate your help

have a great weekend