Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 1 field to load into 2 possible fields based on the value of another field. Source field is f1, output fields are out1, out2, conditional field is c1. Here's what I'd like to happen:
If c1 = 1, load f1 as out1, load f1 as out2
if c1 = 2, load f1 as out1
if c1 = 3, load f1 as out2
if c1 =4, load f1 as out2
I tried using a pick statement like this:
if(c1=1,f1) as out1,
[f1] as pick(c1, 'out1','out1','out2','out2')
but the pick statement breaks.
Any thoughts?
MB
if(match(c1,1,2),f1) as out1,
if(match(c1,1,3,4),f1) as out2,
if(match(c1,1,2),f1) as out1,
if(match(c1,1,3,4),f1) as out2,
You can't use a conditional for the fieldname. Every row will have both an out1 and an out2. Your conditional will be for the value of those fields.
if( match(c1, '1', '2'), f1, '') as out1,
if( match(c1, '1', '3', '4'), f1, '') as out2
I think that's the right idea.
-Rob
Thx - works perfectly.