Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

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

Highlighted
Contributor II
Contributor II

Thanks a lot Javier!

It works! 🙂

 

Regards

Taps

 

 

View solution in original post

2 Replies
Highlighted
Partner
Partner

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

Highlighted
Contributor II
Contributor II

Thanks a lot Javier!

It works! 🙂

 

Regards

Taps

 

 

View solution in original post