Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nadkalyan
Partner - Creator II
Partner - Creator II

Help with calculating 2 weeks Prior Date

Hi,

I am trying to write a expression in a list box based on date to acheive a date prior 2 weeks.

Here is my expression -

=Date(Date#((LoadedDate -14), 'DD/MM/YYYY'))

I get no results when tried above expression.

Can someone please explain me what is the correct expression to acheive this.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Assuming you're using the default date format:

date(LoadedDate-14)

If you need to override it:

date(LoadedDate-14,'DD/MM/YYYY')

The date#() function converts text into the numeric representation of the date.  You don't have text.  You have a number.  So the date#() function isn't what you need.

This is all assuming your LoadedDate is already a QlikView date, and isn't itself a text field.

View solution in original post

2 Replies
johnw
Champion III
Champion III

Assuming you're using the default date format:

date(LoadedDate-14)

If you need to override it:

date(LoadedDate-14,'DD/MM/YYYY')

The date#() function converts text into the numeric representation of the date.  You don't have text.  You have a number.  So the date#() function isn't what you need.

This is all assuming your LoadedDate is already a QlikView date, and isn't itself a text field.

nadkalyan
Partner - Creator II
Partner - Creator II
Author

Thanks John,

date(LoadedDate-14) works exactly i wanted. I was confused by date# function.