Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a trouble with two if statement.
The second if use a value that is create in the first if statement.
LOAD
//First if
if(a<>0, a+1, a+2) as [Value 1],
//Second if
if(b=0, b+2, [Value 1]) as [Value 2]
With this, I obtain an error "Could not find field - <Value 1>.
Can you help me with this ?
Thanks
Use a preceeding load
LOAD
*,
if(b=0, b+2, [Value 1]) as [Value 2]
;
LOAD if(a<>0, a+1, a+2) as [Value 1],
other fields...
FROM ...
;
-Rob
You can't refer to "newly defined fields" as part of the initial load. You would need to do a JOIN LOAD from the same table in order to add your second field by referring to Value 1, or simply restate the same IF condition from your definition of Value 1
if (b=0, b+2, If(a<>0, a+1, a+2)) as [Value 2]
Thanks to you two