Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Enhpad
Contributor II
Contributor II

Script editor

Hello Qlik community,

I have been struggling with a certain script, I want my table to only show rows where column "Positiekey" is DISTINCT and Timestamp is MAX.

This is my current scripteditor:

CancelledOrders:
LOAD
"Timestamp",
PositieKey,

FirstSortedValue(PositieKey,Timestamp) as LatestOrder

Resident cancelledordersv1
Group By PositieKey
Order by PositieKey;

drop table cancelledordersv1;

Enhpad_1-1668776708667.png

 

Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Master
Master

As below.

CancelledOrders:
LOAD
Timestamp(max("Timestamp")) as "Timestamp",
PositieKey,

FirstSortedValue(PositieKey,-Timestamp) as LatestOrder

Resident cancelledordersv1
Group By PositieKey
Order by PositieKey;

drop table cancelledordersv1;

View solution in original post

3 Replies
brunobertels
Master
Master

hi 

may be this 

CancelledOrders:
LOAD
max("Timestamp")  as  Timestamp,
PositieKey,

//FirstSortedValue(PositieKey,Timestamp) as LatestOrder

Resident cancelledordersv1
Group By PositieKey
Order by PositieKey;

BrunPierre
Master
Master

As below.

CancelledOrders:
LOAD
Timestamp(max("Timestamp")) as "Timestamp",
PositieKey,

FirstSortedValue(PositieKey,-Timestamp) as LatestOrder

Resident cancelledordersv1
Group By PositieKey
Order by PositieKey;

drop table cancelledordersv1;

Enhpad
Contributor II
Contributor II
Author

Thank you! This did it for me in a test script, but apparently it was not working for me in my dashboard. So I still have to figure that one out.. 🤔