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: 
Not applicable

Current Date vs Previous Day

In Crystal Reports I am able to use the Current() function to get today's date and then I can say Current()-1 to get the previous day. How can I accomplish the same thing in Qlikview:? Better yet, how can I make previous day (NOT previous month or previous year) as a variable?

Alex

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

For getting Today's date use Today()

For getting Yesterday's date use Date(Today() - 1)

To use this in Set analysis

For Current Date:

Sum({<DateFieldName={'$(=Today())'}>} Sales)

For Yesterday Date:

Sum({<DateFieldName={'$(=Date(Today() - 1))'}>} Sales)

Hope it helps you.

Regards,

Jagan.

View solution in original post

2 Replies
sunny_talwar

From what I understand this is what you are trying to accomplish:

Define your variable like this may be

vPrevious = Date(Num(Today()) -1)

If this is not what you are looking for, then please elaborate.

Best,

S

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

For getting Today's date use Today()

For getting Yesterday's date use Date(Today() - 1)

To use this in Set analysis

For Current Date:

Sum({<DateFieldName={'$(=Today())'}>} Sales)

For Yesterday Date:

Sum({<DateFieldName={'$(=Date(Today() - 1))'}>} Sales)

Hope it helps you.

Regards,

Jagan.