Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
Is it possible to conditionally specify a WHERE statement in QlikView - the following code snippet won't work, but it gives you an idea of what I want to do:
LOAD * FROM STDQVD\TRANSACTIONS.qvd (qvd)
if([Allow Sensitive Transactions]='Y'
,WHERE NOT EXISTS([Transaction Detail Code],1212,1234,1909)
);
Any ideas gratefully received.
Many thanks
George
Yes, possible. Here's one way. "Allow Sensitive Transactions" must be a variable -- perhaps loaded from another table. It can't be part of the transactions.qvd you are loading.
Not syntax checked, but will give you the idea.
LET vCondition = if(vAllowSensitiveTransactions = 'Y',
,' ' // Allow all trans
, 'WHERE NOT match([Transaction Detail Code], 1212, 1234, 1909)'
);
LOAD * FROM STDQVD\TRANSACTIONS.qvd (qvd)
$(vCondition);
-Rob
Yes, possible. Here's one way. "Allow Sensitive Transactions" must be a variable -- perhaps loaded from another table. It can't be part of the transactions.qvd you are loading.
Not syntax checked, but will give you the idea.
LET vCondition = if(vAllowSensitiveTransactions = 'Y',
,' ' // Allow all trans
, 'WHERE NOT match([Transaction Detail Code], 1212, 1234, 1909)'
);
LOAD * FROM STDQVD\TRANSACTIONS.qvd (qvd)
$(vCondition);
-Rob
Thank you Rob. That's just the steer I needed to get this one cracked!