Page 1 of 1

Replacement strings

Posted: Thu Aug 01, 2019 5:18 am
by fi99ggb
I am trying to do the following but it does not work. What is best way to do it?

%SKU = "1111"
%Spec = "X1_{%SKU} X2_{%SKU}"
equation eq
eq.ls log(Y_1111) c {%Spec}

This works but it is not helpful
%Spec = "X1_1111 X2_1111"
equation eq
eq.ls log(Y_1111) c {%Spec}

Thanks
George

Re: Replacement strings

Posted: Thu Aug 01, 2019 8:26 am
by EViews Gareth
Easiest way is probably:

Code: Select all

%spec = "X1_" + %sku + " X2_" + %sku

Re: Replacement strings

Posted: Thu Aug 01, 2019 9:18 am
by fi99ggb
Thanks Gareth. I always appreciate the support.

I guess if my variable is X_1111_Total (instead of X_1111) I will need to define a string (like "X_" + %SKU + "_Total") and then pass it to %Spec. Just wanted to make sure that there is not another cleaner way.

Thanks
George