Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have a problem In the script, below
LOAD *,
(if(Unit= Previous(Unit),previous(sales), 0)) as PREV_sales;
LOAD *
Resident Temp_Data
Order By DATE,Unit;;
the above script is not returning any previous value for that unit where I gone wrong, can any one help me on this.
for sample data PFA.
Regards
John
I got the answer. Thanks All.
Field names are case sensitive, so you need to refer it as Unit in all places.
Original field names are Unit and Sales but you refer as unit and sales (Check Case Sensitive)
Try this
LOAD *,
(if(Unit= Previous(Unit),previous(Sales), 0)) as PREV_sales;
LOAD *
Resident Temp_Scott_Mileage_Data
Order By DATE,Unit;;
Scott_Mileage_Data:
LOAD *,
(if(Unit= Previous(Unit),previous(Sales), 0)) as PREV_sales;
LOAD *
Resident Temp_Scott_Mileage_Data
Order By DATE,Unit;
Drop Table Temp_Scott_Mileage_Data;
Hi John
As others have already mentioned, please check the case of your field names in the script.. Have you managed to resolve your problem?
Sasi
Hi Use this script.
Issue is with sales. Change to Sales.
Data:
LOAD *,
(if(Unit= Previous(Unit),previous(Sales), 0)) as PREV_sales;
LOAD Branch,
Unit,
Month,
Sales,
Year,
Month1
FROM
Data.xlsx
(ooxml, embedded labels, table is Sheet1);
I got the answer. Thanks All.