Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
A Qlikview newbie here who is a novice with SQL. I am loading data from an ODBC connection (Access database) and I want to create an extra field which flags the data as one of two values. Here is the script I have used;
SQL SELECT `campaign_name`,
EMAIL2,
emailID,
`event_name`,
`project_name`,
`time_stamp`,
`workspace_name`
FROM USAGE;
LOAD
if(workspace_name = 'abc','VALUEA',
if(workspace_name = 'def','VALUEA',VALUEB) as email_type_final;
SQL Select *
FROM USAGE;
The new field has been created but all records have been flagged with both VALUEA and VALUEB when only 100 of the records with the value 'abc' or 'def' shoudl be flagged VALUEA. Where have I gone wrong here?
Many Thanks
May you can try this
Load if(wildmatch(workspace_name,'abc','def'),'VALUEA','VALUEB') as email_type_final;
SQL Select *
FROM USAGE;