Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Faiz
		
			Faiz
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
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
 GaryGiles
		
			GaryGiles
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In Qlik Sense you use set analysis to apply a condition like the Having clausing in SQL.
count({$<[Product]={"=sum(Sales)>1000000"}>} Distinct Product)
 Faiz
		
			Faiz
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks. This worked for me:
Count({< [Product] ={"=Sum(SALES)>1000000"}>} Distinct [Product])
