Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
santho_ak
Partner
Partner

If/And condition

Am trying to get the ID numbers where Date field should be empty and result field should be Pass. I am trying to do this within Data Manager.

if([Date]='Null' and [Result]='Pass','Null', ID)

Getting error near the ' ) ' .  Can someone help me out.

Thanks,

SAK

8 Replies
cheenu_janakira
Creator II
Creator II

Hi Santosh,

Unless 'null' is the string in the cells in the column, have you tried "IF(ISNULL(Date) AND Maxstring(Result) = 'Pass', NULL(), ID)"? or otherwise alternatives around the functions being called for in the "if" statement.

Kr,

Cheenu

sasiparupudi1
Master III
Master III

if( Len(Trim([Date]))=0 and [Result]='Pass',Null(), ID)

santho_ak
Partner
Partner
Author

Thanks for the response Cheenu. Unfortunately, its not working.

santho_ak
Partner
Partner
Author

Thanks for the response @Sasidhar Parupudi. Its not working though.

Adding to this, the same 'if' condition was working in direct data load. If I try to do the same in qvd, I am unable to do.

arunaerra
Partner
Partner

Hi

try below  by removing Null()  May be it works

like below

=if( Len(Trim([Date]))=0 and [Result]='Pass', ID)

chinnuchinni
Creator III
Creator III

try this :

load ID,Date(Date) as Date,Result,


if(len(Trim((Date)))=0 and Result = 'Pass' ,ID) as empty_date_ID


;

LOAD * INLINE [

    ID, Date, Result

    1, 1/1/2017, Pass

    2, 1/2/2018, Fail

    3, 1/3/2017, Pass

    4, , Pass

    5, 3/4/2018, Fail

    6, , Pass

];



300542.PNG

ckarras22
Contributor III
Contributor III

Hi,

Then the problem is latter in your script. Usually, error description doesn't refer to the actual line that it has happened

sumitkulkarni
Contributor III
Contributor III

Hi Santhosh,

Try the below expression:

IF(ISNULL([Date]) AND [Result] = 'Pass', 'NULL', [ID])

Thank you!

Best Regards,

Sumit K