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: 
Not applicable

If to case conversion

Hi Anyone,

Can please convert the IF code to case.

If(columnA='RAV', If(columnC> 9, 'RAV After 7 Days', 'RAV Till 7 Days'),

If(columnA='TOT/ODv', If(columnB='OVD', If(columnC> 5,'OVD After 3 Days', 'OVD Till 3 Days')

,'TOT'), columnA)) AS New,

Labels (1)
  • SaaS

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

The case statement in Qlik are control statements and thus can not be used in Load statement.

Do you have any specific reason why you want to go for Case Statement.

http://www.qlikblog.at/546/qliktip-20-selectcase-qlikview-loadscripts/

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

We are using it in Select statement

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I would recommend use of If statement then case statement.

So in your case instead of using the Case statement in Select statement, you should use the If statement in load statement like below.

Load *,

If(columnA='RAV', If(columnC> 9, 'RAV After 7 Days', 'RAV Till 7 Days'),

If(columnA='TOT/ODv', If(columnB='OVD', If(columnC> 5,'OVD After 3 Days', 'OVD Till 3 Days')

,'TOT'), columnA)) AS New;

Sql Select * from xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!