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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

next date using firstValue or fiesrSortedValue

hello.

i have some actions that suposed to hapen in the future.

i need to get the first date fron all the future dates if there are bigger than today.

for example i have the dates 25-03-2016, 13-8-2016, 6-9-2016

and i need to get only 25-03-2016 as next date.

this is the code that i have:

load AccountId,

  if(date(max(DriveDate_DateFormat))>Date(Now()),FirstSortedValue(date(max(DriveDate_DateFormat)),1)) as NextDonationDate,

  Resident DonationEvents

  Group By AccountId;

the error is " Nasted aggegation not allowed"

need your help please

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

Load

     AccountId,

     Min(DriveDate_DateFormat) as NextDonationDate,

Resident

     DonationEvents

Where

     DriveDate_DateFormat > Today()

Group By

     AccountId

     ;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Kushal_Chawda

what is the format of DriveDate_DateFormat?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

Load

     AccountId,

     Min(DriveDate_DateFormat) as NextDonationDate,

Resident

     DonationEvents

Where

     DriveDate_DateFormat > Today()

Group By

     AccountId

     ;


talk is cheap, supply exceeds demand
Not applicable
Author

date

dd/mm/yyyy