Loadcase

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
etuser
Posts: 85
Joined: September 3rd, 2019, 5:57 am

Loadcase

Post by etuser »

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,
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Loadcase

Post by aaronw »

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;
etuser
Posts: 85
Joined: September 3rd, 2019, 5:57 am

Re: Loadcase

Post by etuser »

Thank you Aaron . I will try it, I toughs length of dictionary item should match during loadcase.
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Loadcase

Post by aaronw »

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;
Post Reply