Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pooja821
Creator
Creator

using and operator in if condition

How do we use and operator in if condition.

for eg.

if we need to represent account between 1 million and 5 million, so do we do that?

8 Replies
zhadrakas
Specialist II
Specialist II

in Expression

=if(account >1000000 and account <5000000, THEN , ELSE)

in Script

if(account >1000000 and account <5000000, THEN , ELSE) as Field,

Regards

tim

pooja821
Creator
Creator
Author

I need to use and in above condition for middle account along with aggregate and sum function.

zhadrakas
Specialist II
Specialist II

seems like you should use it like this:

aggr(sum(if(middle_account>1000000 and middle_account<5000000, middle_account)), YourDimension)

pooja821
Creator
Creator
Author

=if(Aggr(sum(Revenue),[Customer Group Descr])<1,'Tail Account',

              if(Aggr(sum(Revenue),[Customer Group Descr])>1 and Aggr(sum(Revenue),[Customer Group Descr])<5,'Middle Account',

                  if(Aggr(sum(Revenue),[Customer Group Descr])>=5,'Large Account'))

I m getting error in this expression

what is wrong with it?

zhadrakas
Specialist II
Specialist II

do you really Need the aggr() function at this Point?

if you have Customer Group Descr as Dimension you can use this expression:

if(sum(Revenue) < 1,'Tail Account',

              if(sum(Revenue)>1 and sum(Revenue) <5,'Middle Account',

                  if(sum(Revenue)>=5,'Large Account')))

pooja821
Creator
Creator
Author

Yes, as I need to group by customer group descry.

pooja821
Creator
Creator
Author

This AND is not working fine.

I m getting invalid dimension error.

zhadrakas
Specialist II
Specialist II

can you share a sample qvw?