Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
having table:
thetable:
load * inline [
field, formula
a, sum(1)
b, sum(2)
c, sum(3)
];
How can I automaticaly define variables $(a) = sum(1), $(b) = sum(2), $(c) = sum(3) out of thetable in script?
E.g. translate thetable into script statements:
let a = sum(1);
let b = sum(2);
let c = sum(3);
Thx - Marcel
Hi Hugmarcel :
Just try this :
test:
load * inline [
field, formula
a, sum(1)
b, sum(2)
c, sum(3)
];
for i = 1 to NoOfRows('test')
let VariableName = FieldValue('field',$(i));
let Formula = Lookup('formula','field','$(VariableName)','Test');
let $(VariableName) = '$(Formula)';
next
Hope that ir helps.
Best Regards
Hi Hugmarcel :
Just try this :
test:
load * inline [
field, formula
a, sum(1)
b, sum(2)
c, sum(3)
];
for i = 1 to NoOfRows('test')
let VariableName = FieldValue('field',$(i));
let Formula = Lookup('formula','field','$(VariableName)','Test');
let $(VariableName) = '$(Formula)';
next
Hope that ir helps.
Best Regards
ok thx, thats working.
However, I was hoping that I could store the variable definitions into a txt file in the script, and then include back the txt file.
But that's not that easy, because of the header of the (txt) file.
Marcel