Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
thomas_2583
New Contributor II

Date Calculation

Hi, 

I need a date formula (Date_offered) to show on a table where it only brings back results where Date_offered is within the next 3 months i.e Jan, Feb and Mar. If Date_offered is in April I don't want that to show until we move into the month of February. 

Date format is YYYY-MM-DD

6 Replies
OmarBenSalem
Esteemed Contributor

Re: Date Calculation

Try:

As dimension : Date_offered 

As a measure: 

sum({<MonthField,YearField,WeekField,Date_offered={">= $(=date(MonthStart(today(1)),'YYYY-MM-DD'))<$(=date(MonthEnd(addmonths(today(1),3)) ,'YYYY-MM-DD'))"} >}YourMeasure)

 

vishus913
Contributor

Re: Date Calculation

HI ,

 

Can you please let me know what today(1) does?

 

OmarBenSalem
Esteemed Contributor

Re: Date Calculation

today() returns the today's date of the day u opened the application.

today(1) always return today's day.

 

Let me explain:

- U opened the application today; 10/01/2018:

today()=10/01/2018

today(1)=10/01/2018

-tomorrow (if u don't close the app / refresh it (let's say u're working with the desktop version)

today()=10/01/2018 (it won't change if the app is not refreshed)

today(1): 11/01/2018 (refreshes automatically without the need to refresh the app)

And here's the explanation in the qlik's help site:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

 

thomas_2583
New Contributor II

Re: Date Calculation

How do I just have this included within the date dimension please?
OmarBenSalem
Esteemed Contributor

Re: Date Calculation

Can u please replicate what I have shared with u?

to test it?

and share the result?

 

thomas_2583
New Contributor II

Re: Date Calculation

I have used it and the variable I get back, is just the value. I just want a criteria on the data to show if the date is within 3 months, the show me within the table and remove the rest of the records
Community Browser