Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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
Partner - Master
Partner - 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
Partner - Master
Partner - 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.. 🤔