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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

conditional expression in straight table

I am using the following expression to exclude anything that is a dummy record or and inactive client - bsically this data contains clients but the users have also created dummy clients - anything with an end date should also be excluded

=IF(\CLIENT.EndDate and \CLIENT.StartDate,'Inactive', ClientNo)

however I noted that 'real' cliemts have an 8 digit no so i tried

=IF(\CLIENT.EndDate and len(ClientNo)<>8,'Inactive', ClientNo) to weed outr dummy clients with clientnos that were not 8 digits

However this did not exclude those records - not sure if i am missing somne obvious parantheses or something



1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Is the field name in the expression correct (\CLIENT.EndDate). I suppose the field names are 'EndDate' and 'ClientNo'. If so, try the following expression,


IF(IsNull(EndDate)=0 and Len(ClientNo)=8,ClientNo,'Inactive')


Regards,

Haneesh


View solution in original post

5 Replies
Not applicable
Author

Hi,

Could you please upload the sample qvw file as I could not understand whether you are using the code in script or any chart.

Thanks & Best Regards,

Kuldeep Tak

Not applicable
Author

Hi,

Is the field name in the expression correct (\CLIENT.EndDate). I suppose the field names are 'EndDate' and 'ClientNo'. If so, try the following expression,


IF(IsNull(EndDate)=0 and Len(ClientNo)=8,ClientNo,'Inactive')


Regards,

Haneesh


amars
Specialist
Specialist

Hi ,

What you could do is , you can include the expression in ur script, in such a way so that the resulting field should contain null values (For duplicate rows or whichever condition you want to achieve). You can include that field in ur table box & on the presentation tab u can select Omit Rows where field is null.Other wise if it is a table chart u can even supress duplicate rows by selecting Supress When value is null in dimension in the dimension.

Thanks.

Not applicable
Author

Morning...afraid i cant upload the file but let me elaborate

expression is bei ng used as a calculated dimension ina straight table - basically it is the first column so that in theory i only show the rows that match

hope that makes sense

Not applicable
Author

haneesh,

thanks - seems to work with one tweak - canged the 0 to -1 for true...