Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Really URGENT How to do firstsorted value in Load script

here is my load script

tablea:

Load

     account,

     id

From ....

tableb:

Load

     expiry-date,

     id,

     effective-date

From ....

How do I get

     Account - Maximum(expiry-date), firstsortedvalue(distinct id, -expiry-date), firstsortedvalue(distinct effective-date, -expiry-date)

In new table.

Please Help.

4 Replies
swuehl
MVP
MVP

You can try joining your two tables, then do a resident load with a group by clause for the aggregations:

tablea:

Load

     account,

     id

INLINE [

account, id

a, 10

b, 20

];

tableb:

JOIN (tablea) Load

     [expiry-date],

     id,

     [effective-date]

INLINE [

expiry-date, id, effective-date

10,10,20

10,10,30

20,20,10

30,20,10

];

LOAD account,

         firstvalue([expiry-date]),

         firstvalue(id),

         firstvalue([effective-date])

Resident tablea GROUP BY account order by account, [expiry-date] desc;

Not applicable
Author

field not found on last last load

swuehl
MVP
MVP

which field not found?

works for me.

Not applicable
Author

There are gods in world. You are one of them. Thank you so much ❤️