Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I have to apply same/repeated condition on each field of table in the load statement e.g.
if(cond1 = true and cond2 = false, field1) as field1
if(cond1 = true and cond2 = false, field2) as field2
if(cond1 = true and cond2 = false, field3) as field3
Can I write these repated conditions in one statement like
load field1, field2, field3
if this condition true.
Regards,
Muhammad Raza
I think this isn't possible but you could simplify the load-statement with variables, like:
set v1 = 'cond1 = true and cond2 = false';
t1:
Load
if($(v1), field1) as field1
.....
I'm not sure if variables with parameter will work within a load-statement, if yes you could make:
set v2 = 'if(cond1 = true and cond2 = false, $1)';
t2:
Load
$(v2(field1)) as field1
.....
- Marcus