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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Script

hey all

i need your help

how can i write in a script

PeriodDate > one year back (noting that periodDate is a number)

and my request is if i am in 15 of april 2015 i need my PeriodDate become Greater in 1 of april 2014 not 15 of april .

Hope you can help thanks.

Regards,

2 Replies
sunny_talwar

Not sure if you are using this in if statement or where clause, but the basic idea for checking should be something like this, if you are checking it against one year back from Today:

MonthStart(Date(PeriodDate)) > AddYears(Today(), -1)


Slight update: Date(PeriodDate) > AddYears(MonthStart(Today()), -1)

HTH

Best,

Sunny

alexandros17
Partner - Champion III
Partner - Champion III

There are lots of Date time functions, MonthStart() set the starting day of the month starting from a date, you can use it for your problem