Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Try
LOAD
IF( Product = 'Toys', [Revenue]+[Tax]+[GP], [Revenue]) as TotalPrice,
...
FROM ...;
Try
LOAD
IF( Product = 'Toys', [Revenue]+[Tax]+[GP], [Revenue]) as TotalPrice,
...
FROM ...;
load
.....,
if(Product ='Toys'
[Revenue]+[Tax]+[GP],
[Revenue]
) as TotalRevenue,
......
from
......
Hi,
The CASE statement is not available in QV. Just use IF statement:
IF (Product='Toys',[Revenue]+[Tax]+[GP],[Revenue]) as TotalRevenue
Mark
Hi Swuehl,
I have a case statement in my SQL select query within qliksense. I keep getting an error when running my load. I am finding that maybe case statements do not work inside Qlik data load editor. How would I write this case statement? Any help would be greatly appreciated!
CASE
SUI.ITEM_TYPE ='B'
THEN SUI.BOM_NET_COST
ELSE SUI.NET_COST
END AS NET_COST
This is what I have but I continue to receive the error message:
IF (SUI.ITEM_TYPE = 'B',
[SUI.BOM_NET_COST],
[SUI.NET_COST])
AS NET_COST