Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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] ??

Tags (1)
11 Replies
antoniotiman
Honored Contributor III

Re: Qlikview Script

After

From YourFile

where [Ticket Type] = 'SomeValue';

Edit : remove last comma

MVP
MVP

Re: Qlikview Script

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
Honored Contributor III

Re: Qlikview Script

or

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

Not applicable

Re: Qlikview Script


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
Honored Contributor III

Re: Qlikview Script

...,

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

as [Ticked Age]

Resident  -Ticket;

MVP
MVP

Re: Qlikview Script

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

add before

resident _Ticket

Not applicable

Re: Qlikview Script

Getting this error after I make the changes you suggested

errorguru.PNG

antoniotiman
Honored Contributor III

Re: Qlikview Script

[Ticket State] not [Ticket state]

antoniotiman
Honored Contributor III

Re: Qlikview Script

Sixth line

Community Browser