Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Taps
Contributor II
Contributor II

Add conditional column in Table

Hi Friends!

I am new to Qliksense and looking forward your support.

How would I add/create a conditional column in Qliksense Table (Not a Pivot or P&L Pivot Table). I don't want to add that column in the source data and load into the table.

Example:  Currently, in the table we have 2 columns (Product_Name and Cost_per_Unit). I would like to add a column which will be automatically updated based on Cost_per_Unit (CpU). If CpU <30  - "Low Cost", 31-40 - "Moderate Cost", >40 - "High Cost".

Please help.

Thanks

Taps

 

Labels (1)
2 Solutions

Accepted Solutions
javiersassen
Partner - Contributor III
Partner - Contributor III

Take the same expression you use to calculate the Cost_per_Unit column and put an IF statement around it:

 

If([expression] < 30,’Low cost’,

if([expression] < 40,’Moderate cost’,

‘High cost’))

 

if the classes have the same bin width you could also use the class() function:

https://help.qlik.com/en-US/sense/April2020/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFu...

 

Good luck!
Javier

View solution in original post

Taps
Contributor II
Contributor II
Author

Thanks a lot Javier!

It works! 🙂

 

Regards

Taps

 

 

View solution in original post

2 Replies
javiersassen
Partner - Contributor III
Partner - Contributor III

Take the same expression you use to calculate the Cost_per_Unit column and put an IF statement around it:

 

If([expression] < 30,’Low cost’,

if([expression] < 40,’Moderate cost’,

‘High cost’))

 

if the classes have the same bin width you could also use the class() function:

https://help.qlik.com/en-US/sense/April2020/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFu...

 

Good luck!
Javier

Taps
Contributor II
Contributor II
Author

Thanks a lot Javier!

It works! 🙂

 

Regards

Taps