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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing two dates in Set Analysis

Hi, I am very new to Qlikview and I am comparing two different dates. In my script I set

LET vThreeDayAgo = Dayname(today()-3); so the variable ends up looking like this 09/07/2012 today.

I am comparing this in this set analysis syntax but get the sum of everything for DaysFilled.Days in the table.

The DaysFilled.Date is formatted mm/dd/yyyy. I have verified that there is a DayFilled.Date = 09/07/2012.

sum({$<DaysFilled.Date={"=vThreeDayAgo"}>} DaysFilled.Days)

Can someone tell me what is wrong with the above Set analysis?

Any ideas would be greatly appreciated.

Thank you,

OnePuttGirl

15 Replies
whiteline
Master II
Master II

Use this (as your vThreeDayAgo is just a string):

=Sum({< DaysFilled.Date = {'=$(vThreeDayAgo)'} >} DaysFilled.Days)

Not applicable
Author

try this exp:

sum({<Date = {">=$(#=vStartdate) <$(#=vEndDate)"}>} value)

Hopefully, this will solve your problem.

If this exp doesn't work then remove '=' sign and try again:

sum({<Date = {">=$(#vStartdate) <$(#vEndDate)"}>} value)

Not applicable
Author

try this exp:

sum({<Date = {">=$(#=vStartdate) <$(#=vEndDate)"}>} value)

Hopefully, this will solve your problem.

If this exp doesn't work then remove '=' sign and try again:

sum({<Date = {">=$(#vStartdate) <$(#vEndDate)"}>} value)

Miguel_Angel_Baeyens

Hi,

The format in the variable and the field are not the same, therefore the zeroes in the result. Check the ammended application and see how the variable has changed and works.

Hope that helps.

Miguel

Not applicable
Author

Thank you, Thank you, Thank you!
Miguel I did finally get that they were different formats. Thank you for the followup because it's really nice to know there are people out there to help with problems.

rajni_batra
Specialist
Specialist

Hi miguel,

i saw application of both but could nt get any change in the variable its dayname(today()-3) in both but output of variables are diffrent in both.. how?

Can u plz explain a bit