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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Filter on Date

Hi Guys,

i have a date DD/MM/YYYY field - i would like to reload the table taking just the value of the previous 12 month.

How this can be done?

For example if i run it today i would get the data from 01/08/2017 till Today.

Thank you

1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

Use AddMonths instead, like this:

let vDate = Num(AddMonths(MonthStart(Today()),-11)); 

View solution in original post

5 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Antonio,

Do the following (assuming the date field is a numeric date interpretation)

// this will get the 01/08/2017 based of today's date.

let vDate = Num(AddYears(MonthStart(Today()),-1));

Load *

From [Whatever]

where [Date Field]>=$(vDate);

Felipe.

qlikviewaf
Creator
Creator
Author

the result is 01/07/2018 instead of 01/08/2018

let vPrevious12Month = Num(AddYears(MonthStart(Today()),-1));

felipedl
Partner - Specialist III
Partner - Specialist III

Use AddMonths instead, like this:

let vDate = Num(AddMonths(MonthStart(Today()),-11)); 

vishus913
Partner - Creator
Partner - Creator

hi yes,

Felip is right

add months would do the job

felipedl
Partner - Specialist III
Partner - Specialist III

Glad it helped .