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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AGGR() or FIRSTSORTEDVALUE() - Help?

Hi

I need some help storing a flag for a oldest date with a minimum value.

This is my data. I need a flag that will give me the OLDEST Date where Hours<MinHours for any Staff member.

The flag value in the bottom data should then be 01/11/2014.

Untitled.png

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this in script

LOAD

Date(Min(Date)) AS OLDEST_Date

FROM DataSource

WHERE Hours < MinHours;

Or in front end

Date(Min(Aggr(If(Hours <  MinHours, Date), Staff, Date, Hours, MinHours)))

Hope this helps you.

Regards,

Jagan.

View solution in original post

4 Replies
morganaaron
Specialist
Specialist

Do you need the flag for each Staff member, or just one value overall?

If you need one value you could use: Date(Min(If(Hours<MinHours,Date,)))

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this in script

LOAD

Date(Min(Date)) AS OLDEST_Date

FROM DataSource

WHERE Hours < MinHours;

Or in front end

Date(Min(Aggr(If(Hours <  MinHours, Date), Staff, Date, Hours, MinHours)))

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

thanx that worked, i just changed the min/date at the front

Not applicable
Author

Thanx alot, that script just saved me, so simple but so effective