
Contributor
2021-03-20
06:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count distinct products with condition
I want to count of distinct products whose sale is more than 1 million. How can I write below expression in Qlik Sense?
SELECT
Count(distinct c.[Product])
FROM Sales a
INNER JOIN Item c ON a.[Item No.]=c.[Item No.]
Having Sum(a.Sales)>1000000
1,013 Views
2 Replies

Specialist
2021-03-20
07:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Qlik Sense you use set analysis to apply a condition like the Having clausing in SQL.
count({$<[Product]={"=sum(Sales)>1000000"}>} Distinct Product)
988 Views

Contributor
2021-03-20
07:49 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. This worked for me:
Count({< [Product] ={"=Sum(SALES)>1000000"}>} Distinct [Product])
962 Views
