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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
vpanchuda
Contributor III
Contributor III

Multiple If and Statements after checking

ComplianceApprovalindicatorApproval date
   
N/AYes 
N/AYes 
N/ANO01-01-2019
N/ANO 
N/ANO 

 

IF(Compliance='N/A' AND ApprovalIndicator='true','Approved N/A',
iF(Compliance='N/A'AND ApprovalIndicator='false','Not Approved N/A',


Compliance))) as CalculatedCompliance,

 

In the above table, I have coded the above syntax and works fine, I also have to add one more if in the same loop for the below condition, not able to get the syntax.

iF(Compliance='N/A' AND ApprovalIndicator='false',  and [here i have to check if anything  is entered in this cell it can be date or any string in Approvaldate field  ) 'Approved N/A',

Can anyone help me with syntax, please?? ie

if Compliance =N/A and

ApprovalID=NO and

if any value is present in the Approval date column then it should return 'Approved N/A' (this could be number or string in the cell)

 

Labels (1)
1 Solution

Accepted Solutions
zzyjordan
Creator II
Creator II

Hi, there

try this

IF(Compliiance='N/A' AND Approvalindicator='Yes','Approved N/A',
IF(Compliiance='N/A'AND Approvalindicator='No' and (Not isnull("Approval Date")),'Approved N/A',
iF(Compliiance='N/A'AND Approvalindicator='No','Not Approved N/A',Compliiance)
)
) as calc

aa.JPG

ZZ

View solution in original post

4 Replies
Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi there

You can add Len(Trim([Approval date])). Len looks at how many characters there is in the field and trim removes all the spaces. It will return 0 if the cell is completely empty or only has spaces and a number greater than 0 if there is anything at all. So your condition will be Len(Trim([Approval date]))>0 in your if statement. For example:

iF(Compliance='N/A' AND ApprovalIndicator='false'  AND Len(Trim([Approval date]))>0, <True result>,<False result>)

Good luck,

Mauritz

zzyjordan
Creator II
Creator II

Hi, there

try this

IF(Compliiance='N/A' AND Approvalindicator='Yes','Approved N/A',
IF(Compliiance='N/A'AND Approvalindicator='No' and (Not isnull("Approval Date")),'Approved N/A',
iF(Compliiance='N/A'AND Approvalindicator='No','Not Approved N/A',Compliiance)
)
) as calc

aa.JPG

ZZ

vpanchuda
Contributor III
Contributor III
Author

THank you ,I tried with alt function and it worked (but i shall try with this as well a different approch though)
vpanchuda
Contributor III
Contributor III
Author

This worked , I even used the alt function and that also worked .