Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
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
Specialist III
Specialist III

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
Specialist III
Specialist III

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.. 🤔