Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclude rows from the data

Hi all,

I have the below set of data (<Time, Column1,  Column2,Column3>)where Time should be the primary key but since there are duplicates in Time. I have to remove the first occurrence of 'Time' and consider the second or the last occurrence.

TimeColumn1Column2Column3RowNo()
25/10/16 8:00:00 PM2341
25/10/16 8:00:00 PM356

2

25/10/16 9:00:00 PM4633
25/10/16 10:00:00 PM2494
25/10/16 10:00:00 PM4785

For this, I added RowNo() to the table and thought of considering the row with Maximum value for a particular Time.

Is there any way to remove the first occurrence from the data itself and get the below result in the LOAD Script.

TimeColumn1Column2Column3RowNo()
25/10/16 8:00:00 PM356

2

25/10/16 9:00:00 PM4633
25/10/16 10:00:00 PM4785

Thanks and Regards,

Anjali Gupta

1 Reply
maxgro
MVP
MVP

Source:

LOAD

  Timestamp#(Time, 'DD/MM/YY hh:mm:ss ff') as Time,

     Column1,

     Column2,

     Column3,

     [RowNo()]

FROM

[https://community.qlik.com/thread/237954]

(html, codepage is 1252, embedded labels, table is @1)

;

Final:

NoConcatenate load * Resident Source

Where Time <> Peek('Time')

order by Time desc;

DROP Table Source;