Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
syahfira
Partner - Contributor III
Partner - Contributor III

Any function works opposite to CLASS()?

Hi, I'm new to Qlik Sense. 

I have created a formula using Class() function. But it didn't fulfill my expected output.

Class() will give an output like this : a <= x < b

My expected output is this : a < x <= b

Is there any function or way to get my expected output?

Thank you 🤗

Labels (2)
12 Replies
Channa
Specialist III
Specialist III

it is always

A<=X<Y

 

u can try using interval match for custom grouping

Channa
Vegar
MVP
MVP

What if you class the negative values.

Instead of class(expression) use class(-expression).

You will need to do some string manipulating to get the presentation correct but I believe the class grouping will meet your needs.
syahfira
Partner - Contributor III
Partner - Contributor III
Author

Could you elaborate more on the interval match custom grouping?
Appreciate it so much.
Thank you.
syahfira
Partner - Contributor III
Partner - Contributor III
Author

Hi. Thank you for the suggestion.
Unfortunately, it won't work for the class grouping.
Thank you.
Vegar
MVP
MVP

This page should be a good place to start.
https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Sc...

In the example you could consider OrderLog as the table defining your intervals and EventLog containing the numeric fields in which you want to define a interval for.
vireshkolagimat
Creator III
Creator III

Hi, try using something like below as calculated dimension.

=replace(replace(class(age,10),'<','<='),'<==','<')

In the above case, i took age as dimension and added it as a calculated dimension.

Regards,
Viresh
syahfira
Partner - Contributor III
Partner - Contributor III
Author

Hello. Thank you for replying. 

Actually, you have replacing the sign only. It won't change for the value to fall into the respective class.

This is not the right approach.

age band.jpg

 

tresesco
MVP
MVP

You can probably adjust your value sub subtracting a min unit like:

=Replace(Replace(Class(YourValue -0.001,10),'<','<='),'<==','<') 

 

 

Vegar
MVP
MVP

You could do like I've done in the picture below.

image.png