Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My expression:
IF(Min(MONTHYEAR) > Min(MONTHYEAR2) and isnull(FIELD1),FIELD1B,if(Min(MONTHYEAR) > Min(MONTHYEAR2) and len(FIELD1)>0,FIELD1)) as Value
I need this:
1.-if(Min(MONTHYEAR) > Min(MONTHYEAR2) and isnull(FIELD1) output FIELD1B
2.-if(Min(MONTHYEAR) > Min(MONTHYEAR2) and isnotnull(FIELD1) output FIELD1
What I am doing wrong? Thanks!
Looks ok to me. If you're using this expression in a load script then make sure to add every field that is not used in an aggregation function, like min(), to the Group By clause of that load.
May be this:
If(Min(MONTHYEAR) > Min(MONTHYEAR2), If(Len(Trim(FIELD1)) = 0, FIELD1B, FIELD1)) as Value
But note that you will get null when Min(MONTHYEAR) <= Min(MONTHYEAR2). If that's what you want then above should work for the two conditions you have give above.