11 Replies Latest reply: Mar 18, 2014 5:32 AM by Rohit Koul

# Set analysis and adding an absolute value to only one year

Hello,

I have an object which goes as follows:

=Sum ( {<[Financial Year]={\$(vYears)}>} [Amount])

The variable 'vYears' has two values: 2012 en 2013.

The result is the sum(Amount) for 2012 and 2013.

Now I want to add 1000 only to the year 2012.

I con't figure out how. Any Help?

Thanks!

Message was edited by: Jasper de Vries

• ###### Re: Set analysis and adding an absolute value to only one year

If you are using the expression in a textbox,

=Sum ( {<[Financial Year]={\$(vYears)}>} [Amount])+1000

should return the correct result, right?

But you are probably using the expression in a chart with multiple dimensions.

But how should the constant value for the year then distributed across your dimension values?

• ###### Re: Set analysis and adding an absolute value to only one year

Hi swuehl,

Unfortunately that's not what I mean. If I follow your advise, 1000 wil be added to both years while I want to add 1000 only to one year, while 2 years are shown.

• ###### Re: Set analysis and adding an absolute value to only one year

try like these

=Sum ( {<[Financial Year]={\$(=(vYears)-1)}>} [Amount])+1000

or

=Sum ( {<[Financial Year]={\$(=Max(vYears)-1)}>} [Amount])+1000

or

create varible for 1 year which year you want then make that variable use

• ###### Re: Set analysis and adding an absolute value to only one year

Hi ,

try this,

=if(\$(vYears)='2012',Sum ( {<[Financial Year]={\$(vYears)}>} [Amount])+1000,Sum ( {<[Financial Year]={\$(vYears)}>} [Amount]))

Regards,

• ###### Re: Set analysis and adding an absolute value to only one year

Thanks guys, but I doesn't solve my problem.

I attached an example QVW to my orginal post. Hope this will clarify my issue.

• ###### Re: Set analysis and adding an absolute value to only one year

= sum ({\$<[Financial Year] = {\$(vYears)}>} Amount)+sum({\$<[Financial Year] = {"2012"}>}1000)

• ###### Re: Set analysis and adding an absolute value to only one year

Try this

= Sum ({\$<[Financial Year] = {\$(vYears)}>} Amount ) + If([Financial Year] = 2012, 1000, 0)

• ###### Re: Set analysis and adding an absolute value to only one year

Hi Jasper,

the solution is a simple if condition on Fincancial Year:

=If([Financial Year] = 2012, sum({\$<[Financial Year] = {\$(vYears)}>} Amount ) +1000, sum({\$<[Financial Year] = {\$(vYears)}>} Amount))

Enjoy

Burkhard

• ###### Re: Set analysis and adding an absolute value to only one year

Hi Jasper,

you can use "IF"code if([Financial Year] = '2012', sum ( {\$} Amount ) +1000 , if([Financial Year] = '2013', sum ( {\$} Amount ) ))

PFA for help.

• ###### Re: Set analysis and adding an absolute value to only one year

Thanks for the effort QlikPhadi07. I just rated the other answers and apparently I can only mark 2 answers as 'Helpful', but yours does the trick as wel.

• ###### Re: Set analysis and adding an absolute value to only one year

No issues Jasper but yes you can like the answer enough for me .

Happy Qlicking

• ###### Re: Set analysis and adding an absolute value to only one year

Thanks guys!

All of the solutions worked!