2 Replies Latest reply: Mar 9, 2018 6:58 AM by Subrato Kumar

# Converting if to set?

I have two dimensional field named as BPA and EC , both are text.I have used an if clause can anyone help me converting it to to a set clause I have used the code below:

=if(BPA='Bil',EC)

Result expected  all the EC names which satisfies BPA equal to Bill.

• ###### Re: Converting if to set?

Set Analysis must be used with Aggregation functions like Min, Max, Count, Avg, Sum etc.

What exactly you want to do here?

You can use something like below

COUNT({<BPA = {'Bil'}>}Distinct EC)

But from your above if statement, don't understand what exactly you are doing.

If you have used your If statement as a Calculated Dimension... then you can simply use EC there.

And use BPA field as a Set Expression

i.e.

SUM({<BPA = {'Bil'}>}YourField)

• ###### Re: Converting if to set?

I don't want any numeric field(no aggregation function). I wish to find those values (text) of the 'YourField'  column which satisfies 'BPA'(field name) ='bill' (value in that field).