Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to create a new column "report_type" by referencing 3 different columns. I tried using the wildmatch function, but did not work (see script below).
Each of the columns I'm referencing (kpi, aib, cancellation) have values of either 0 or 1 (binary).
Load
Text(kpi) as kpi,
Text(aib) as aib,
Text(cancellation) as cancellation,
if(WildMatch(kpi,'1'), 'KPIs',
if(WildMatch(aib,'1'), 'AIB',
if(WildMatch(cancellation,'1'), 'Cancellations'))) as report_type,
I don't think you need the wildmatch. Check the value of the fields as Qlik sees them, but generally binary fields will show as 0, 1 or possibly -1. Then just do the direct comparison. Also, I like to indent my nested 'ifs' to make it easier to follow:
if(kpi,='1',
'KPIs',
if(aib='1',
'AIB',
if(cancellation='1',
'Cancellations',
'Other'
)
)
) as report_type,
I figured out my logic would not work as there could be more than 1 columns with a value of 1. Thanks for the help anyway!