7 Replies Latest reply: Mar 4, 2015 7:02 AM by amir ohev shalom

# Dimension with case

Hello all,

I want to built dimension with sum of expression.
For example:

i have table like this

Month number count

--------- --------- ----------

jan      22222    100

jan      22222     205

jan      33333     150

feb      22222     50

feb      33333     100

feb      33333      50

and i want to add dimension  (type) that wiil show me -  if(sum(count)>'300','big','small')

Month number count  type

--------- --------- ----------  -------

jan      22222     305     big

jan      33333     150   small

feb      22222     50     small

feb      33333     150   small

if i add expression with this case i get blank field.

Amir

• ###### Re: Dimension with case

Try =aggr(if(sum(count)>'300','big','small'),Month)

• ###### Re: Dimension with case

Try using it like this (without the single quotes)

=If(Sum(Count)>300,'big','small')

HTH

Best,

S

• ###### Re: Dimension with case

try the following as dimensions:

Aggr(If(Sum(Count) >= 300, 'BIG', 'Small') , Month)

• ###### Re: Dimension with case

Hi,

Can You use in script

TEST:

Month,Number,Count

jan,      22222  ,  100

jan  ,    22222 ,    205

jan ,     33333 ,    150

feb  ,    22222  ,   50

feb ,     33333  ,   100

feb  ,    33333  ,    50

];

TEST2:

Month,

Number

Resident TEST Group by

Month,Number;

DROP Table TEST;

Regards

Vimlesh

• ###### Re: Dimension with case

Dim: Month,number

Expr: sum(count)

if(sum(count)>'300','big','small')

• ###### Re: Dimension with case

Create a Straight Table with

Dimensions:

Month

Number

Expressions.

Sum(Count) // label the expression i.e: TotalCount

=if(TotalCount>300, 'Big', 'Small') // Reference the label of the above expression and test on it.

• ###### Re: Dimension with case

Thank you all