Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

Case statement in Load script

Hi,

i'm new to qlikview, can we write a case statement in Load script  as we do in the sql select statement? when i try to write the below script its giving me syntax error, can someone please help me in solving this.

CASE WHEN (Product ='Toys')

THEN ([Revenue]+[Tax]+[GP]) ELSE

([Revenue]) END TotalRevenue

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Case statement in Load script

Try

LOAD

     IF( Product = 'Toys', [Revenue]+[Tax]+[GP], [Revenue]) as TotalPrice,

     ...

FROM ...;

3 Replies
MVP
MVP

Re: Case statement in Load script

Try

LOAD

     IF( Product = 'Toys', [Revenue]+[Tax]+[GP], [Revenue]) as TotalPrice,

     ...

FROM ...;

MVP
MVP

Re: Case statement in Load script

load

     .....,

     if(Product ='Toys'

          [Revenue]+[Tax]+[GP],

          [Revenue]

     ) as TotalRevenue,

     ......

from

     ......

mark_casselman
Contributor

Re: Case statement in Load script

Hi,

The CASE statement is not available in QV. Just use IF statement:

IF (Product='Toys',[Revenue]+[Tax]+[GP],[Revenue]) as TotalRevenue

Mark

Community Browser