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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rmadursk
Contributor III
Contributor III

Set expressions to exclude nulls and count distinct elements not working.

I have a set of data that looks like this:

Attested_Date Service
3/31/2023 satellite01
3/31/2023 wbscvecc11
3/31/2023 wbscvecc11
12/31/2023 rtvspx01
12/31/2023 rtvspx01
6/30/2024 triprh701
6/30/2025 wbscvecm04
6/30/2025 wbscvecm04
12/31/2025 spcsgridn02
12/31/2025 spcsgridn02
12/31/2025 spcsgsub01
12/31/2025 spcsmtier01
12/31/2025 spcsmdata01
- wbscvemp21
- wbscvmdm01
- wbscvmdm01
- wbscvmgr01
- wbscvmgr90

 

I need to know how many Distinct Service names have an Attested_Date.

I've tried the following based on other Community posts:

//Count({$<[Attested_Date] = {"=not isnull([ATTESTED_DATE] )"}>} DISTINCT([Service]))
//Count({$<[Attested_Date] -= "=Null()">} DISTINCT([Service]))
//Count({$<[Attested_Date] = {'*'}>} DISTINCT([Service]))
//Count({$<[Attested_Date] = {"=Len(Trim([Attested_Date])) > 0"}>} DISTINCT([Service]))
//Count({$<[Attested_Date] = {'*'}-{''}>} DISTINCT([Service]))

These all just report back the count of distinct services (14) when it should be 9.

This expression appeared to be working a couple of days ago but stopped for some reason.  I don't think it is the app since I created a new app with just this table and I get the same results.  The Null fields appear to be actual Null fields because they show up in Data Manager Preview Pane as Nulls.

Labels (1)
10 Replies
rmadursk
Contributor III
Contributor III
Author

I really like this idea. There are several fields/expressions that I think I can use this tactic to make my sheets less complicated.  Just have to remember to do them all before I split and unpivot the troublesome column.