Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
deepaktibhe
Contributor
Contributor

Variable error - unknown load statement error

Hi All,

 

We are using variables in the script as per the below,

 

LOAD *,
Dual (If ([Delivery Difference Days] > 0,
If ([Delivery Difference Days] <= 5, 'Week or Less',
If ([Delivery Difference Days] <= 10, 'Two Weeks or Less',
If ([Delivery Difference Days] <= 20, 'Month or Less',
If ([Delivery Difference Days] <= 40, 'Two Months or Less', 'Over Two Months'))))),
If ([Delivery Difference Days] > 0,
If ([Delivery Difference Days] <= 5, 1,
If ([Delivery Difference Days] <= 10, 2,
If ([Delivery Difference Days] <= 20, 3,
If ([Delivery Difference Days] <= 40, 4, 5)))))) as [Late Status];
LOAD [Sales Document Item Key],
Sum ([Date Type]) as [Delivery Difference Days]
GROUP BY [Sales Document Item Key];
LOAD [Sales Document Item Key],
ApplyMap ('Factory Calendar Map', [Original Factory Calendar] & '-' & Num ([Original Planned Delivery Date] + Iterno ()), 0) as [Date Type]
WHILE Num ($(vMinDate) + Iterno ()) <= Num (Today ());
LOAD [Sales Document Item Key],
[Original Factory Calendar],
[Original Planned Delivery Date]
RESIDENT [Order Delivery]
WHERE Num ([Original Planned Delivery Date]) < Num (Today ()) AND (Isnull ([Comparison Date]) OR (RangeSum ([Delivered Quantity Punctuality]) - RangeSum ([Original Confirmed Quantity])) < 0);

 

We have declared the created variable in the Variable Overview section as

min(Date([Original Planned Delivery Date]))

However, an error Unknown load statement occurs repetitively.

Could you, please suggest on this.

 

Thanks

 

 

3 Replies
MayilVahanan

Hi @deepaktibhe 

Try like below

Load min(Date([Original Planned Delivery Date])) as MinDate resident yourDeliveryDateAvailableTableName;

Let vMinDate = Peek('MinDate');

Instead of create in front end.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
deepaktibhe
Contributor
Contributor
Author

Hi,

I tried with the above condition. However, the same error persists.

Thanks

MayilVahanan

Hi @deepaktibhe

Can you send the sample data with ur script.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.