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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to compare dates in an application

I Have a column with date type data. User will select a date from list box. how can i select the date immediately less than the value selected by the user. so that i can fetch other data corresponding to the date immediately less than the date selected from list box.

Thanks for your time....

6 Replies
Not applicable
Author

Hi,

I`m not clear about your requirement.

But if you want to select all the date below the selected date, then go for below expression.

=Sum (all if(Date<max(total Date), Sales))


Hope this should help you.

Cheers Yes

- Sridhar

Not applicable
Author

No.. No.. There are many experts in this forum... Zip it!

I just started my life in qlikview Paradise Travel


- Sridhar

Not applicable
Author


sridhar24784 wrote:
Hi,
=Sum (all if(Date<max(total Date), Sales))


Hi thnaks for reply but this will return sum for all dates below the selected date. i want value for the date which is immidiately below the selected vale

Suppose

Dtae Value

5/09/1998 155

6/09/1998 26

8/09/1998 123

if user select 8/09/1998 then is shall get value for 6/09/1998 which is immediately less to 8/09/1998

Please have a lookk......thanks



Not applicable
Author

Hi Dude,

Check the attachment.

You need to go for this below expression.

=date(max(all aggr(sum(all<Date> if(Date<max(total Date), Date)), Date)),'DD-MM-YYYY')

Cheers Beer

- Sridhar

sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi

Can u attch ur application here. Then it is easy for solve the problem..........

-Sathish

Not applicable
Author

Hi,

One more additional info.

if you wan to select next second max value from the selected date you have to use this following code and by increasing the number in max parameter you can find the next to next max value respectively.

=date(max(all aggr(sum(all<Date> if(Date<max(total Date), Date)), Date),2),'DD-MM-YYYY')

=date(max(all aggr(sum(all<Date> if(Date<max(total Date), Date)), Date),3),'DD-MM-YYYY')

=date(max(all aggr(sum(all<Date> if(Date<max(total Date), Date)), Date),4),'DD-MM-YYYY')

Cheers, Happy Selecting Yes

- Sridhar