Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
swethasmilek
New Contributor III

How to write the Date Expressions with the Offset -1 for day/Month

The data displayed on the report have an offset of -1, ie, on April 19th, the data is as of April 18th.

Need to  offset the day by ‘-1’.

When the report is opened, the month filter should be on March not on April. You need to  offset the day by ‘-1’

By using this variable able to display the Previous day.

How to write in if else conditional statement if(April-1)->March

LET vRefreshDate = Today()-1;

1 Solution

Accepted Solutions

Re: How to write the Date Expressions with the Offset -1 for day/Month

Yes that is what it will give you.

vRefreshMonth = Month(Today() - 1)

vRefreshDate = Date(Today() - 1)

View solution in original post

10 Replies

Re: How to write the Date Expressions with the Offset -1 for day/Month

May be this:

vRefreshMonth = Month(Today() - 1)

or for date

vRefreshDate = Date(Today() - 1)

Chanty4u
Esteemed Contributor III

Re: How to write the Date Expressions with the Offset -1 for day/Month

or

=date(urdate-1)


or


=Date(Today()-1)

swethasmilek
New Contributor III

Re: How to write the Date Expressions with the Offset -1 for day/Month

If I' Using the vToday() then above things will work.I have a Column with Cal_Year.

By max(Cal_Taer) i can get the max-Month,date but how to put in the if else logic if(vday=1,vmonth=May,vday=31,vMonth=April)-Actually i'm trying in this way but no luck.Expecting solution as stated.

Re: How to write the Date Expressions with the Offset -1 for day/Month

This doesn't seem like a good way, but may be this:

If(vday = 1 and vmonth = 'May' and vday = 31, 'April')

swethasmilek
New Contributor III

Re: How to write the Date Expressions with the Offset -1 for day/Month

Sorry,I didn't explained in good way.I kept the expression for Understandable.

I'm expecting in dynamic way if every month start it should take the prior month last date.

Expecting in the multi conditional statement in a Text Object.

How can the above Scenario can be achieved?

rgvavihs
Valued Contributor

Re: How to write the Date Expressions with the Offset -1 for day/Month

=Month(MonthName(Today())-1)

Re: How to write the Date Expressions with the Offset -1 for day/Month

Is there a sample you can share? I am not entirely sure how your data looks like

rgvavihs
Valued Contributor

Re: How to write the Date Expressions with the Offset -1 for day/Month

Hi

like this

=Date(MonthStart(Today())-1)

swethasmilek
New Contributor III

Re: How to write the Date Expressions with the Offset -1 for day/Month

    On Open of the Document need to get the Year,Month.

Attached the sample,implemented the Triggers .

My Question is the Variable "vRefreshMonth = Month(Today() - 1)"

,will always give the expect result like below or is there any other way to achieve this

Refresh DateExpected DateExpected Month
4/19/20164/18/2016  Apr
5/1/2016          4/31/2016    Apr
5/2/20165/1/2016May