Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to include only those records that has a null Value

I have a straight table. I want the table to display metrics only for values that do not have an expiration date. Can I do that with a calculated dimension. I tried =if([Expiration date] ='-', [Expiration date]) and hide the column. Its not working. pls advise.

null value.JPG

7 Replies
sunny_talwar

Try this expression:

=Sum({<[Expiration date] = e([Expiration date] = {'*?'})>} Cost)

I think this should work.

Best,

Sunny

robert_mika
Master III
Master III

You do not need extra dimension

only({1-<ExpirationDate={*}>} Cost)

2015-04-18 02_17_18-QlikView Personal Edition - [C__Users_Katarzyna_Desktop_160620.qvw_].png

or without Expiration date dimension:

2015-04-18 02_19_48-QlikView Personal Edition - [C__Users_Katarzyna_Desktop_160620.qvw_].png

ramoncova06
Partner - Specialist III
Partner - Specialist III

here is another alternative


Sum({$<ProductID={"=nullcount(ExpirationDate)>0"}>} Cost )


this is based out of HIC document

https://community.qlikview.com/docs/DOC-3155/version/7

anbu1984
Master III
Master III

Sum(If(IsNull(ExpryDt), Cost))

Or

Sum({<ProdID={'=IsNull(ExpryDt)'}>}Cost)

Anonymous
Not applicable
Author

Robert, the function I am using is not sum in my app. It is a filter that I have created in the script. However the logic remains the same. as of now My expression is

=count({<[extra inventory]={1}>} Distinct [TRANS_ID])  Where [extra inventory] is the condition I created in the script. and I have a straight table thats pulling records that satisfies the condition. but it is also pulling all values in expiration date field. how do I show only those that do not have an expiration date. I tried : =count({<[extra inventory]={1}, [expiration date]={'*'}>} Distinct [TRANS_ID])  and it brought those records that had expiration dates. how do I achieve the opposite of it, i.e. records that do not have an expiration date. I am hoping for a fix on the front end. either a set anlaysis expression combined with my main expression above or a calculated dimension for the [expiration date]. Thanks much


ramoncova06
Partner - Specialist III
Partner - Specialist III

count({$<ProductID={"=nullcount([expiration date])=0"}, [extra inventory] = {1}>} distinct [TRANS_ID])

or on your current expression change it to [expiration date] -= {'*'}

anbu1984
Master III
Master III

=count({<[extra inventory]={1}>} Distinct If(IsNull([expiration date]),[TRANS_ID]))