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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Doubt with Class function

Hi

I have this dimension

=IF(DIAS_PLAZO>=120, 'x =< 120', CLASS(DIAS_PLAZO, 30))

It's working ok, but i get this

 

0 <= x < 30
30 <= x < 60
60 <= x < 90
90 <= x < 120

And i wanna see this

  0 <= x <= 30

  30 < x <= 60

  60 < x <= 90

  90 < x <= 120


Is this possible?


Thank you


Regards,

1 Solution

Accepted Solutions
sunny_talwar

May be just do this:

=IF(DIAS_PLAZO <= 30, '0 <= x <= 30',

  IF(DIAS_PLAZO <= 60, '30 < x <= 60',

  IF(DIAS_PLAZO <= 90, '60 < x <= 90',

  IF(DIAS_PLAZO <= 120, '90 < x <= 120', 'x =< 120'))))

View solution in original post

3 Replies
sunny_talwar

May be just do this:

=IF(DIAS_PLAZO <= 30, '0 <= x <= 30',

  IF(DIAS_PLAZO <= 60, '30 < x <= 60',

  IF(DIAS_PLAZO <= 90, '60 < x <= 90',

  IF(DIAS_PLAZO <= 120, '90 < x <= 120', 'x =< 120'))))

swuehl
MVP
MVP

You can easily replace the class() function with rounding functions ceil() and floor() , thus controlling which limit to exclude and include:

LOAD *,

if(ID>120, dual('x > 120',121) , dual(floor(ID, 30) & ' < x <= '& ceil(ID, 30), ceil(ID,30) ) ) as Class;

LOAD recno() as ID

AutoGenerate 121;

Clever_Anjos
Employee
Employee

Maybe this equivalent values

1 <= x < 31

31 <= x < 61

61 <= x < 91

91 <= x < 121

LOAD

  class(RowNo(),30,'x',1) as c

AutoGenerate 120;