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

Is it possible to pick a particular date from last year dynamically ?

Hi,

Currently our app only displays data from this year and last year .Date starts from 01/01/2013  and ends today 07/16/2014.

Currently I'm filtering the records in the qvd by using the following code

 

where  num(sales_order_date)>=41275;

A:

Load *

from myqvd (qvd)

where num(sales_order_date)>=41275;

How can I dynamically pick the first day of jan last year and use it to filter the qvd

The problem is qlikview treats dates as string

Thanks

B

1 Solution

Accepted Solutions
4 Replies
Anonymous
Not applicable
Author

Now I want to dynamically pick 01/01/2013...next yeatr it should be 01/01/2014...so on instead of hardcoding

Anonymous
Not applicable
Author

date(sales_order_date) = date(yearstart(today()))

swarup_malli
Specialist
Specialist


Try this

qvsample.png

sunilkumarqv
Specialist II
Specialist II

Try like this

let vPrevDate=num(MakeDate((Year(Today())-1),1,1))

vPrevDateCreate the last year Date (Jan 1, 2013) as set in the SET DateFormat=’M/D/YYYY’ .

and then create varible for same as above for current year

let vTodayDate=num(MakeDate((Year(Today())),1,1))

.

vTodayDate created for Date(Jan 1, 2013)