How to create a derived column in load script editor based on multiple columns
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: