Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Team,
I have 2007-2011 data, where i have to read only latest 3 years data. I have order date field. I am trying with below line, but not working. Can you please give me the solution.
Created two variables - vMaxYear =Year(today())-4 (2011)
vMinYear =Year(today())-6 (2009)
Load
OrderID,
Year(OrderDate) as YearOrderDate,
ShipperID
FROM
[..\Stage1\Orders.qvd]
(qvd) Where Year(OrderDate) >=$('vMinYear') and Year(OrderDate) <=$('vMaxYear');
Regards,
Sridhar
Do you have this before your load?
LET vMaxYear =Year(Today())-4;
LET vMinYear =Year(Today())-6;
Load
OrderID,
Year(OrderDate) as YearOrderDate,
ShipperID
FROM
[..\Stage1\Orders.qvd]
(qvd)
Where Year(OrderDate) >=$(vMinYear) and Year(OrderDate) <=$(vMaxYear);
Try this:
Load
OrderID,
Year(OrderDate) as YearOrderDate,
ShipperID
FROM
[..\Stage1\Orders.qvd]
(qvd) Where Year(OrderDate) >=$(vMinYear) and Year(OrderDate) <=$(vMaxYear); //Use variables without single quotes
Hi Sridhar,
Please try removing the quotes for the variables. Also create a text box in the front end and please evaluate your variable if they are giving correct result or not
Regards
chitra
It is showing the error as
Field not found - <and>
Can you please why so?
I have checked the variables from front end. Still without quotes it is not working Chitra.
Showing below error.
Field not found - <and>
Do you have this before your load?
LET vMaxYear =Year(Today())-4;
LET vMinYear =Year(Today())-6;
Load
OrderID,
Year(OrderDate) as YearOrderDate,
ShipperID
FROM
[..\Stage1\Orders.qvd]
(qvd)
Where Year(OrderDate) >=$(vMinYear) and Year(OrderDate) <=$(vMaxYear);
Hi,
I have created variables from variable overview, now i have tried doing with your solution and it is working. Is it must? does not it work if we create from variable overview?
Thanks.
I would think that once it is created in variable overview, it should work in the script, but I may be wrong as I have never tested it out. To be on a safer side, I have always created the variable in the script whenever I wanted to use it in the script.
HTH
Best,
Sunny
Thanks Sunny.