Dear Sir,
I created a lookup file which contains prices of goods at different geographical level in on file per record , is there a possibility to do first an EA level match and if item found at ea level the compare and take EA price , if not go to district and ......
The file look like ---> Region Zone District EA EA Price District Price zone price EA Price
Thank you,
Loadcase
-
aaronw
- Posts: 571
- Joined: June 9th, 2016, 9:38 am
- Location: Washington, DC
Re: Loadcase
Does this logic behave the way you want?
if loadcase(DICT_PRICES, ZONE, DISTRICT, EA) then
if PRICES_EA <> notappl then
// impute logic for EA
// ...
elseif loadcase(DICT_PRICES, ZONE, DISTRICT) then
if PRICES_DISTRICT <> notappl then
// impute logic for District
// ...
elseif loadcase(DICT_PRICES, ZONE) then
if PRICES_ZONE <> notappl then
// impute logic for Zone
// ...
endif;
endif;
endif;
endif;
if PRICES_EA <> notappl then
// impute logic for EA
// ...
elseif loadcase(DICT_PRICES, ZONE, DISTRICT) then
if PRICES_DISTRICT <> notappl then
// impute logic for District
// ...
elseif loadcase(DICT_PRICES, ZONE) then
if PRICES_ZONE <> notappl then
// impute logic for Zone
// ...
endif;
endif;
endif;
endif;
-
etuser
- Posts: 99
- Joined: September 3rd, 2019, 5:57 am
Re: Loadcase
Thank you Aaron . I will try it, I toughs length of dictionary item should match during loadcase.
-
aaronw
- Posts: 571
- Joined: June 9th, 2016, 9:38 am
- Location: Washington, DC
Re: Loadcase
You're correct, the combined length of the variables needs to be equal to the length of the case id. Take a look at this:
if loadcase(DICT_PRICES, ZONE, DISTRICT, EA) then
if PRICE_EA <> notappl then
// impute logic for EA
// ...
else if PRICE_DISTRICT <> notappl then
// impute logic for District
// ...
else if PRICE_ZONE <> notappl then
// impute logic for Zone
// ...
endif;
endif;
if PRICE_EA <> notappl then
// impute logic for EA
// ...
else if PRICE_DISTRICT <> notappl then
// impute logic for District
// ...
else if PRICE_ZONE <> notappl then
// impute logic for Zone
// ...
endif;
endif;