Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

Text Object Expression

Hi,

I tried the following expression in a text object to highlight the size:

Small <=100

Medium between 100 - 200

Large greater than 200

Expression:  =if(max([Size)<=100,'Small',if(max(Size)='>100<=200','Medium','Large'))

The above does not seem to work correctly. Any idea on what should be the correct expression?

Thanks

1 Solution

Accepted Solutions
Kushal_Chawda

=If(Max(Size) <= 100,'Small',If(Max(Size) > 200,'Large','Medium'))

View solution in original post

7 Replies
devarasu07
Master II
Master II

Hi,

Try like this,

=if((Size<=100),'Small',

        if((Size>100) and (Size<=200),'Medium ',

              'Large')

)

Capture.JPG

antoniotiman
Master III
Master III

=If(Max(Size) <= 100,'Small',If(Max(Size) <= 200,'Medium','Large'))

kamal_sanguri
Specialist
Specialist

You have provided conditions incorrectly,

Incorrect:

=if(max([Size)<=100,'Small',if(max(Size)='>100<=200','Medium','Large'))


the condition highlighted in Red is incorrect, it should be if(max(Size)>100 and max(Size)<=200)

Other conditions are OK.

Correct One:

=if(max(Size)<=100,'Small',if(max(Size)>100 and max(Size)<=200,'Medium','Large'))

kamal_sanguri
Specialist
Specialist

Since you have handled values less than 100 in first condition, the max(Size)>100 is actually not required in your second condition for Medium.

=if(max(Size)<=100,'Small',if(max(Size)>100 and max(Size)<=200,'Medium','Large'))


So, this is enough


=if(max(Size)<=100,'Small',if(max(Size)<=200,'Medium','Large'))

Sergey_Shuklin
Specialist
Specialist

Hello, Shamit!

What is the size? Is it some field or a text object parameter like "Width"/"Height"?

Or you want to color text object depend on calculation? If so, then you must use color defining condition.

Kushal_Chawda

=If(Max(Size) <= 100,'Small',If(Max(Size) > 200,'Large','Medium'))

shamitshah
Partner - Creator
Partner - Creator
Author

Thanks , that worked out.

Shamit