Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Forgive me as I am a total newbie to Qlikview and to SQL data sets as a whole.
Basically I have a dataset that includes tickets from many different sources. I want to categorize them by adding a new column to the data set during the data load and populate it based on criteria I have predefined. Written below is how I would write it in plain English to create a new column labeled "Ticket Type" and write a value into it based on where/if match from an existing column in the dataset, however I do not know how this would translate to qlikview language.
From what I have read this would be accomplished by a load inline command, just not sure how the syntax would translate.
where modified_by_department = 'DeptA' and Source_System = 'SourceA' write "PLANNED WORK" in column "TICKET TYPE"
where ticket_type = 'TickettypeA' write "SYSTEM ALERT" in column "TICKET TYPE"
where workgroup = 'WorkgroupA' write "USER REQUEST" in column "TICKET TYPE"
where workgroup = 'WorkgroupB' write "TROUBLE TICKET" in column "TICKET TYPE"
Any help is appreciated, thanks in advance!
Thanks for the assistance, wanted to circle back that I eventually used a CASE statement as I was not able to get the if statement syntax to work on my SQL query. Essentially looked like this with specifics changed:
CASE
WHEN
MODIFIED_BY_DEPT = 'DEPT A' AND WORKGROUP = 'WORKGROUP A'
THEN
'TICKETTYPEA'
WHEN
WORKGROUP = 'WORKGROUP B'
THEN
'TICKETTYPEB'
ELSE
'Null'
END AS TICKETTYPEMASTER,
if(modified_by_department = 'DeptA' and Source_System = 'SourceA'.'PLANNED WORK'.
if(ticket_type = 'TickettypeA','SYSTEM ALERT',
if( workgroup = 'WorkgroupA','USER REQUEST',
if(workgroup = 'WorkgroupB','TROUBLE TICKET')))) as "TICKET TYPE",
Thanks for the assistance, wanted to circle back that I eventually used a CASE statement as I was not able to get the if statement syntax to work on my SQL query. Essentially looked like this with specifics changed:
CASE
WHEN
MODIFIED_BY_DEPT = 'DEPT A' AND WORKGROUP = 'WORKGROUP A'
THEN
'TICKETTYPEA'
WHEN
WORKGROUP = 'WORKGROUP B'
THEN
'TICKETTYPEB'
ELSE
'Null'
END AS TICKETTYPEMASTER,