Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have tried to run the below code, but it keeps coming up with CASE_TYPE Field not found error anytime I run the script, while the field clearly is on the database because I pull the field using my SELECT statement.
Code:
IF([TIER]='GOLD',
if(match([Case_Type],'Incident'),
IF([DECODE_PRIORITY]='High' AND [Arrival to Resolve Days]<=1,'SLA MET',
IF([DECODE_PRIORITY]='Urgent' AND [Arrival to Resolve Days]<=1,'SLA MET',
If([DECODE_PRIORITY]='Medium' AND [Arrival to Resolve Days]<=3,'SLA MET',
IF([DECODE_PRIORITY]='Low' AND [Arrival to Resolve Days]<=10,'SLA MET','SLA Not Met'))))),
IF([TIER]='GOLD',
if(match([Case_Type],'Request'),
IF([DECODE_PRIORITY]='High' AND [Arrival to Resolve Days]<=1,'SLA MET',
IF([DECODE_PRIORITY]='Urgent' AND [Arrival to Resolve Days]<=1,'SLA MET',
If([DECODE_PRIORITY]='Medium' AND [Arrival to Resolve Days]<=5,'SLA MET',
IF([DECODE_PRIORITY]='Low' AND [Arrival to Resolve Days]<=10,'SLA MET','SLA Not Met'))))),
IF([TIER] = 'SILVER',
IF([DECODE_PRIORITY]='High' AND [Arrival to Resolve Days]<=3,'SLA MET',
IF([DECODE_PRIORITY]='Urgent' AND [Arrival to Resolve Days]<=3,'SLA MET',
IF([DECODE_PRIORITY]='Medium' AND [Arrival to Resolve Days]<=10,'SLA MET',
IF([DECODE_PRIORITY]='Low' AND [Arrival to Resolve Days]<=20,'SLA MET','SLA Not Met'))))))) as SLA;
Then based on Bill analysis, try to change your load part:
if(match([CASE_TYPE],'Incident'),
Can you share your whole script of this table?
With the load AND select statements?
Hi Omar,
Please find the attached script. ignore the commented out codes, as I am only trying to test LOAD STATEMENT lines of codes. Thanks
For this bit of your script that is part of your sql query :
Decode(case_type ,0,'Incident'
,1,'Request'
,2,'Request') AS Case_Type
Put Case_Type in double quotes
Decode(case_type ,0,'Incident'
,1,'Request'
,2,'Request') AS "Case_Type"
Most variants of SQL databases will auto convert the field name to uppercase without the double quotes and Qlik is case sensitive.
Hi Bill,
When I did this, it gave me an error with the connector.
Then based on Bill analysis, try to change your load part:
if(match([CASE_TYPE],'Incident'),
I know this is elementary, but have you considered only doing the first little section. Test that, Make sure it works, then add the rest of the script. The match will return a value, then an evaluation of true/false will be the result from the number returned.
-gw
Thanks!! this works
Hi Victor,
What are the values in the field which is causing you error
Its the field CASE_TYPE, but Omar has resolved it for me, I had to make it upper case.