Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
Is there any better way to store field value in variable based on another field value at script level?
I have used below approach .
Wheels:
LOAD * INLINE [
Indicators, Logged_Value
torque percent, 2.3
shear factor, 0.5
error, 0.0005
];
NoConcatenate
temp:
LOAD * ,
RowNo() as sno
Resident Wheels where Match(Indicators,'torque percent');
LET vtorque_percent = Peek('Indicators',0,'temp') ;
DROP Table temp ;
temp:
LOAD * ,
RowNo() as sno
Resident Wheels where Match(Indicators,'shear factor');
LET vshear_factor = Peek('Indicators',0,'temp') ;
DROP Table temp ;
temp:
LOAD * ,
RowNo() as sno
Resident Wheels where Match(Indicators,'error');
LET verror = Peek('Indicators',0,'temp') ;
DROP Table temp ;
DROP Table wheels;
Hi, a different way to load them can be like:
Wheels:
LOAD * INLINE [
Indicators, Logged_Value
torque percent, 2.3
shear factor, 0.5
error, 0.0005
];
FOR i=0 to NoOfRows('Wheels')
LET vIndicator = Peek('Indicators',$(i),'Wheels');
LET varName = 'v'& Replace('$(vIndicator)',' ','_');
LET $(varName) = Peek('Logged_Value',$(i),'Wheels');
NEXT
DROP Table Wheels;
Hi, a different way to load them can be like:
Wheels:
LOAD * INLINE [
Indicators, Logged_Value
torque percent, 2.3
shear factor, 0.5
error, 0.0005
];
FOR i=0 to NoOfRows('Wheels')
LET vIndicator = Peek('Indicators',$(i),'Wheels');
LET varName = 'v'& Replace('$(vIndicator)',' ','_');
LET $(varName) = Peek('Logged_Value',$(i),'Wheels');
NEXT
DROP Table Wheels;