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

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

Compare Date with Variable Date in Set Analysis

Hi

Facing an issue with the below expression, could you help?

[Program Date] = {"<=Date($(vSelectedDate), 'dd/MM/yyyy')"}

Here variable vSelectedDate = 31 Jan 2013

regards,

Bobby

9 Replies
sushil353
Master II
Master II

hi,

make sure that the data type and format of [Program Date] and vSelectedDate should be same..

try to see the format using test box : =vSelectedDate..

and then use in setanalysis as

[Program Date] = {"<=$(vSelectedDate)"}

also try this:

[Program Date] = {"<=date#($(vSelectedDate), 'dd/MM/yyyy'))"}

HTH

Sushil

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at your other post.

     http://community.qlik.com/thread/79048?tstart=0

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

HI ,

      Please try the below code

[Program Date] = {'$(=date#(vSelectedDate, 'DD MMM YYYY'))'}

Please let me know if there is anything .

Not applicable
Author

Hi Bobby,

Im assuming that [Program Date] is in the format dd/MM/YYYY?

You will have to convert vSelectedDate to this format using the following formula:

[Program Date] = {"<=Date(date#($(vSelectedDate), 'DD MMM YYYY'), 'dd/MM/yyyy')"}

Regards

Not applicable
Author

Hi Bobby,

Im assuming that [Program Date] is in the format dd/MM/YYYY?

You will have to convert vSelectedDate to this format using the following formula:

[Program Date] = {"<=Date(date#($(vSelectedDate), 'DD MMM YYYY'), 'dd/MM/yyyy')"}

Regards

Not applicable
Author

Hi Bobby,

Im assuming that [Program Date] is in the format dd/MM/YYYY?

You will have to convert vSelectedDate to this format using the following formula:

[Program Date] = {"<=Date(date#($(vSelectedDate), 'DD MMM YYYY'), 'dd/MM/yyyy')"}

Regards

Not applicable
Author

Hi Bobby,

Im assuming that [Program Date] is in the format dd/MM/YYYY?

You will have to convert vSelectedDate to this format using the following formula:

[Program Date] = {"<=Date(date#($(vSelectedDate), 'DD MMM YYYY'), 'dd/MM/yyyy')"}

Regards

swuehl
MVP
MVP

If you need to interpret / parse your variable, you should use the date#() function and an appropriate format code:

Date#(vSelectedDate, 'DD MMM YYYY')

then maybe you need to use an additional Date() function to format your date according to [Program Date]'s format. Assume [Program Date] is formatted like 'MM/DD/YYYY':

Date(Date#(vSelectedDate, 'DD MMM YYYY'),'MM/DD/YYYY')

to execute an expression like above in a set analysis field modifer, you'll need to use a dollar sign expansion with expression:

[Program Date] = {"<=$(=Date(Date#(vSelectedDate, 'DD MMM YYYY'),'MM/DD/YYYY'))"}

Not applicable
Author

Hi Bobby,

[Program Date]={"<=$(vSelectedDate)"}

vSelectedDate-> format this in a variable

Try this.

Regards,

Sukamal