Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
amiroh81
Creator
Creator

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.

thanks in advaned

Amir

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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


talk is cheap, supply exceeds demand
sunny_talwar
MVP
MVP

Try using it like this (without the single quotes)

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

HTH

Best,

S

Not applicable

try the following as dimensions:

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

Not applicable

Hi,

Can You use in script

TEST:

LOAD * INLINE [

Month,Number,Count

jan,      22222  ,  100

jan  ,    22222 ,    205

jan ,     33333 ,    150

feb  ,    22222  ,   50

feb ,     33333  ,   100

feb  ,    33333  ,    50

];

TEST2:

LOAD Month&Number&Sum(Count) as KEY,

Month,

Number

Resident TEST Group by

Month,Number;

DROP Table TEST;

Regards

Vimlesh

anbu1984
Master III
Master III

Dim: Month,number

Expr: sum(count)

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

simenkg
Specialist
Specialist

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.

amiroh81
Creator
Creator
Author

Thank you all