Qlik Community

Qlik Sense on AWS & Azure

Discussion board where members can learn more about Qlik Sense deployments on Public Cloud Infrastructures such as AWS and Azure.

Highlighted
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,

3 Replies

Re: If to case conversion

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

Not applicable

Re: If to case conversion

We are using it in Select statement

Re: If to case conversion

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