Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Please tell me how can I use the decode function in QlikView as we use in SQL.
Like in sql I write:
sum(SELLING_PRICE)/decode(sum(NUM_DEVICES),0,1,sum(NUM_DEVICES))/1000
How can I write this in QlikView expression?
Thanks in advance for your time.
Regards
No you cannot use decode function in expression
Selva
Hi,
Yes you can not use decode function in Qlikview but
You can use if -else as alternative to decode
Use like this,
sum(SELLING_PRICE)/if(sum(NUM_DEVICES)=0,1,sum(NUM_DEVICES))/1000
or
If(sum(NUM_DEVICES)=0,SUM(SELLING_PRICE),
SUM(SELLING_PRICE)/SUM(NUM_DEVICES)
)/1000
Regards
Thanks Max !