Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Script

Hello everyone,

LOAD *,
1
as Counter,

 
[Ticket Number] as TicketNumberKey, // key filed to link SLA table

  if ([Ticket Type]='Incident',1,0) as [CounterIncident],

 
if ([Ticket Type]='Catalog Task',1,0) as [CounterTask]

I want to declare a filter using the field [Ticket Type] after the above three lines. As I have renamed it to [Counterincident] and [CounterTask] based on the stages, how do I use the field [Ticket Type] ??

11 Replies
antoniotiman
Master III
Master III

After

From YourFile

where [Ticket Type] = 'SomeValue';

Edit : remove last comma

maxgro
MVP
MVP

what is declare a filter?

if you want filter in the script you can add

where [Ticket Type]=...

in the user interface you can use a listbox on [Ticket Type]

antoniotiman
Master III
Master III

or

where Match([Ticket Type],'Incident','Catalog Task') > 0;

Not applicable
Author


This is my Script,


Ticket:

LOAD

*,

  1
as Counter,

 
[Ticket Number] as TicketNumberKey, // key filed to link SLA table

  if ([Ticket Type]='Incident',1,0) as [CounterIncident],

 
if ([Ticket Type]='Catalog Task',1,0) as [CounterTask],

   
Date(MonthStart([Created Date]),'YYYY-MM') as [Created YM],

 
Date(MonthStart([Closed Date]),'YYYY-MM') as [Closed YM],

   
Year([Closed Date])-2000 + if(num(month([Closed Date]))> 1,1,0) as [Closed FY], //- Financial Year

    Year([Created Date])-2000 + if(num(month([Created Date]))> 1,1,0) as [Created FY], //- Financial Year

    [Assignment Group] as AssignmentGroupKey,

   
[Customer Name] as Customer,

 
ApplyMap('TMAP_TicketState',[Ticket State],'NOMATCH') as [Ticket Status]// New, Assigned, In Progress, Waiting, Closed

  ApplyMap('TMap_FormName',Form) as [Form Name],

 
Capitalize(ApplyMap('TMAP_Country', Country,Country)) as [Cust Country]//-Cleanup Country

  if( Division = '','[No Value]',Division) as [Cust Division],
if( [Customer Platform]='','[No Value]',[Customer Platform]) as [Cust Platform],
 
if ([Software CI]='',[Configuration Item], [Software CI]) as CI,
Resident _Ticket

//where [Created Date] >= MakeDate(2014,07,01)

I want to add the following condition to calculate Ticket age, where do I ad it?

If
(
Ticket state = 'Open' or Ticket State = 'Pending Additional Information' or Ticket State = 'Assigned' or Ticket State = 'Work in Progress'

or Ticket State = 'Awaiting Assignment' or Ticket State = 'New' and (Ticket type = 'Incident' or Ticket Type ='Catalog Task'),

(Resolved Date - Created Date)*24*60 ) as Ticket Age

antoniotiman
Master III
Master III

...,

If(Match([Ticket State],'Open','Pending Additional Information,..........), ([Resolved Date] - [Created Date])*24*60))

as [Ticked Age]

Resident  -Ticket;

maxgro
MVP
MVP

if all the fields you use in the condition are in the _Ticket table

add before

resident _Ticket

Not applicable
Author

Getting this error after I make the changes you suggested

errorguru.PNG

antoniotiman
Master III
Master III

[Ticket State] not [Ticket state]

antoniotiman
Master III
Master III

Sixth line