Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
balrajprabhu
Creator II
Creator II

Script doesn't filter records when I try to filter by dates ?

 

Hello,

I''m trying to filter records that are older than jan 01 2013 in the script dynamically i.e. conceptually something like filter sale_date > = year(today()-1),

 

Let vMaxdate  =Year (today);
table:

LOAD

*
FROM


[New folder\fact_SalesOrder_Line_Extracted.qvd]
(
qvd

)
where  year  (sales_order_date) >= $(vMaxdate) -1;


exit script

;

My requirements are as follows:

I do not want to hard code 01/01/2013 in the script , it has to be dynamic.The dashboard  shows  data from this year and last year.

It has to be neat and elegant  and has to be done in the script editor and not front end.

Balraj

1 Solution

Accepted Solutions
VishalWaghole
Specialist II
Specialist II

Hi Balraj,

Try this logic, hope it works for you.

let vMinDate = AddYears(yearstart(Today()),-1)

LOAD    *

FROM    [New folder\fact_SalesOrder_Line_Extracted.qvd](qvd)

where   sales_order_date >= $(vMinDate);

-- Regards,

Vishal Waghole

View solution in original post

2 Replies
VishalWaghole
Specialist II
Specialist II

Hi Balraj,

Try this logic, hope it works for you.

let vMinDate = AddYears(yearstart(Today()),-1)

LOAD    *

FROM    [New folder\fact_SalesOrder_Line_Extracted.qvd](qvd)

where   sales_order_date >= $(vMinDate);

-- Regards,

Vishal Waghole

balrajprabhu
Creator II
Creator II
Author

You are the man ! 🙂 Worked like a charm!