Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
muhammadraza
Partner - Creator
Partner - Creator

Repeated conditions on each field in load statement

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

1 Reply
marcus_sommer

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