This content has been marked as final.
Show 3 replies
-
Re: Questions about if and variables in scripts
Sunny Talwar Jan 25, 2017 8:45 AM (in response to s Walter)May be this:
set vartest = "Hello";
set newTest = "";
if $(vartest) = 'Hello' THEN
$(newTest) = $(vartest) & ' World!',
ELSE
$(newTest) = $(vartest) & ' how are you?'
END IF;
tbl_name:
LOAD fieldname,
$(newTest) as NewTest;
LOAD * Inline
[fieldname,
a
b
c
];
-
Re: Questions about if and variables in scripts
Marcus Sommer Jan 25, 2017 12:07 PM (in response to Sunny Talwar )I think it should be more look like this:
set vartest = Hello;
set newTest = "";
if '$(vartest)' = 'Hello' THEN
let newTest = '$(vartest)' & ' World!',
ELSE
let newTest = '$(vartest)' & ' how are you?'
END IF;
tbl_name:
LOAD fieldname,
'$(newTest)' as NewTest;
LOAD * Inline
[fieldname,
a
b
c
];
- Marcus
-
-
Re: Questions about if and variables in scripts
Rahul Pawar Jan 27, 2017 12:03 AM (in response to s Walter)Hello Walter,
Hope you are doing well!
Please modify your script as below:
set vartest = "Hello"; LET newTest = if(vartest like "Hello", vartest & ' World!', vartest & ' how are you?'); TRACE $(newTest);
Thank you!
Rahul