7 Replies Latest reply: May 13, 2015 8:39 AM by Marcus Sommer RSS

    Getting invalid Expression when using multiple  IF condition

      Hi ,

       

      Original Code:

      load [ID], if(max(isDraft)=1 and min(isDraft)=0, 2, if( max(isDraft) <2, 1, max(isDraft)) ) as docMaxPublishedVersion,

      if(max(isDraft)=1 and min(isDraft)=0 , 1, 0 ) as oneDraftOnePublish

      resident AdminDoc

       

      Modified Code:

      load [docID], if(max(isDraft)=1 and min(isDraft)=0, 2, if( max(isDraft) <2,1,if(DocIsDeleted = 1 ,Version,max(isDraft))) ) as docMaxPublishedVersion,

      if(max(isDraft)=1 and min(isDraft)=0 , 1, 0 ) as oneDraftOnePublish

      resident AdminDoc

       

      We have added one more condition to the Original Code( i.e DocIsDeleted ), adding this if condition in Modified Code, results in INVALID EXPRESSION.

       

      Also tried ISNULL , got same error.

       

      please advice.

       

      thanks in advance