Skip to main content

App Development

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

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER 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
Specialist II
Specialist II

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

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

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