Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the first or last instance

Hi,

May I ask how to get the first or second or last instance for the query below.

I would like get the first and second instance of Transferre Date per Ticket. But as you can see in the attached image, most of the ticket number have duplicates because one ticket can transfer many times. My problem is how will I be able to get the first and second instance of transferred date.

Thank you

3 Replies
hic
Former Employee
Former Employee

If you use "Ticket" as dimension in a chart, and your "Transferred Date" is correctly interpreted as a date, then you can simply use

   Date(Min([Transferred Date]))

for the first "Transferred Date" for that ticket. And you can use

   Date(Min([Transferred Date], 2))

for the second "Transferred Date".

HIC

Not applicable
Author

Hi Henric,

Im sorry for confusion.

I have four fields to use for this script.

1. Ticket

2 Assignee

3. Date Opened

4. Transferred Date.

Query 1: My dimension will be the Assignee, and im going to count the tickets transferred in first instance. Ticket number may have duplicates depends on how many times it was transferred.

Query 2: Same as with Query 1 but this time im going to get the second instance of transferred date.

Thank you

hic
Former Employee
Former Employee

I would then try:

Query1: Count(Aggr(distinct Min([Transferred Date],1),Ticket))

Query2: Count(Aggr(distinct Min([Transferred Date],2),Ticket))

HIC