Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jagjivvt
Creator
Creator

If / and in script not working

Hi Please help.

i am using multiple if / and in script and the result is not correct. see below

" if([Formula Code]= 'Entityonly' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N', 'Hold' ,

      

       if([Formula Code]= 'EntityPO'  and Len_Latest_PO_Number2='N' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N', 'Hold' ,

      

         if([Formula Code]= 'EntityWork' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N' and Len_Worker='N', 'Hold' ,

       

          if([Formula Code]= 'IFS'  and Len_Correct_Site='N'  and [Len_IFS Business Unit]='N' and Len_WE='N', 'Hold' ,

        

          if([Formula Code]= 'SiteWE' and Len_Correct_Site='N'  and Len_WE='N', 'Hold' ,

        

          if([Formula Code]= 'Wname' and Len_Correct_Site='N'  and Len_WE='N' and Len_Worker='N', 'Hold' ,

        

          if(isnull([Formula Code])= -1, 'Hold' ,

       

          if([Formula Code]= 'Done on a different Report', 'Hold',

        

          'Release')))))))) as Action,"

thanks

vijay   

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Have a look at the attached file.

View solution in original post

13 Replies
Anil_Babu_Samineni

Try this?

if([Formula Code]= 'Entityonly' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N',

if([Formula Code]= 'EntityPO'  and Len_Latest_PO_Number2='N' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N',

if([Formula Code]= 'EntityWork' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N' and Len_Worker='N',

if([Formula Code]= 'IFS'  and Len_Correct_Site='N'  and [Len_IFS Business Unit]='N' and Len_WE='N',

if([Formula Code]= 'SiteWE' and Len_Correct_Site='N'  and Len_WE='N',

if([Formula Code]= 'Wname' and Len_Correct_Site='N'  and Len_WE='N' and Len_Worker='N',

if(isnull([Formula Code])= -1,

if([Formula Code]= 'Done on a different Report', 'Hold','Release')))))))) as Action

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jagjivvt
Creator
Creator
Author

Hi,

that did not return any Action.

vijay

Anil_Babu_Samineni

So, What you got currently.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jagjivvt
Creator
Creator
Author

The result should be either Hold or Release and when i apply the change you provided it does not do any of the 2.

thanks

vijay    

Anil_Babu_Samineni

Not mine, i am talking about yours. You said that "Values returning wrong" Can you show image where it wrong? Better if you provide samples

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jagjivvt
Creator
Creator
Author

Hi i have attached the qvw

tamilarasu
Champion
Champion

Hi Vijay,

Which lines are wrong? Also can you let us know what you want to see?

jagjivvt
Creator
Creator
Author

Hi, if you look at EnityPO, if there is N in the Len_Latest_PO_Number, then the result should he Hold, but its putting Release .

thanks

vijay    

Anonymous
Not applicable

if (([Formula Code]= 'Entityonly' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N')

OR ([Formula Code]= 'EntityPO'  and Len_Latest_PO_Number2='N' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N')

OR ([Formula Code]= 'EntityWork' and Len_Correct_Site='N' and Len_Select_legal_Entity='N' and Len_WE='N' and Len_Worker='N')

OR ([Formula Code]= 'IFS'  and Len_Correct_Site='N'  and [Len_IFS Business Unit]='N' and Len_WE='N')

            OR ([Formula Code]= 'SiteWE' and Len_Correct_Site='N'  and Len_WE='N')

          OR ([Formula Code]= 'Wname' and Len_Correct_Site='N'  and Len_WE='N' and Len_Worker='N')        

    OR (isnull([Formula Code])= -1)

    OR ([Formula Code]= 'Done on a different Report'), 'Hold'        

          , 'Release') AS Action        

          ,'Solution2' AS Solution