4 Replies Latest reply: Jun 15, 2016 8:03 PM by Anton Pääkkönen

# Expression with multiple conditions

Hey,

I'm building an expression which should work like this:
I have a data set which has columns for year, for amount and for item. I want to make the chart to show only the items which have their amount of year='2014' higher than year='1995'.

I've tried the following

IF(((year='1995' and "amount")<(year='2014' and "amount")), "item")

which was a long shot and didn't get me far.

Any help with the expression? Thanks.

• ###### Re: Expression with multiple conditions

Hi,

if(Sum({<Year={'1995'}>}amount)<Sum({<Year={'1995'}>}amount),'item')

• ###### Re: Expression with multiple conditions

This is used in a calculated dimension?

=Aggr( If( Sum({<year = {1995}>} amount) < Sum({<year = {2014}>} amount), item), item)

• ###### Re: Expression with multiple conditions

Thanks for all. This did the trick at once - perfect!

• ###### Re: Expression with multiple conditions

May be like this in your expression:

Sum({<items = {"=Sum({<year = {2014}>} amount) > Sum({<year = {1995}>} amount)"}>} amount)