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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
heathqm
Partner - Contributor III
Partner - Contributor III

x

 
Labels (2)
1 Reply
maxgro
MVP
MVP

I'm not sure to understand your question.

If you want for every Key the Title of the first DataSourceOrder and the most recent BudgetDate you can use the peek function. An example:


// test data
T:
LOAD
CEIL(RAND()*5) as Key,
CEIL(RAND()*8) as DataSourceOrder,
DATE(makedate(2020) + FLOOR(RAND()*365*3)) as BudgetDate,
'Title ' & rowno() as Title,
ROWNO() as ID
AutoGenerate 100;

// flag the first record when the key change
//
F:
NOCONCATENATE
LOAD
*,
IF(Key <> PEEK('Key'), 1, NULL()) as FirstTitle_By_DataSourceOrderAndBudgetDateDesc
RESIDENT
T
ORDER BY
Key,
DataSourceOrder,
BudgetDate DESC
;

DROP TABLE T;

 

maxgro_0-1671218668514.png