Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 dhruvkumar_josh
		
			dhruvkumar_josh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All Qlik Experts,
I am facing one issue in Aggr function.
Scenario:
I need the count of customer who has been missed to be server particular product Rolling 4 Weeks.
so i applied aggr functiion, at summary level the count of customer is not coming proper but if i select any one product its coming proper.
Expression is :
=count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} aggr(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer),Customer))
For more info please refer the attached screenshot.
Thanks,
Dhruv.

 
					
				
		
 andrey_krylov
		
			andrey_krylov
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi, Dhruv. Try this
=Sum({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} if(aggr(max({<[Distribution R12W]={9,10,11,12}, TOTAL<Customer> [All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer), 1))
 
					
				
		
 dhruvkumar_josh
		
			dhruvkumar_josh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Andrey for your quick reply.
But when i am using your suggested expression is not working becuase of that Total <Customer>. can you please recheck and help it.
=Sum({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} if(aggr(max({<[Distribution R12W]={9,10,11,12}, TOTAL<Customer> [All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer), 1))
Thanks,
Dhruv
I think this will suffice
Count(aggr(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer),Customer))
 
					
				
		
 dhruvkumar_josh
		
			dhruvkumar_josh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Anil,
While applying your given expression , it's only giving me 1 Product code and doesn't shows other code .
can you please check it because the logic wise my expression is correct but not working properly.
Thanks.
Can you attach sample
 
					
				
		
 dhruvkumar_josh
		
			dhruvkumar_josh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Do you want image or Design part?
if the design part, then it is too heavy so not possible to attach. i
 balabhaskarqlik
		
			balabhaskarqlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this expression:
=if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0,
Aggr(
count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>}Customer),
Customer)
)
 balabhaskarqlik
		
			balabhaskarqlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be try this:
=Count(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0,
Aggr(
count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>}Customer),
Customer)
))
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What exactly is your dimension in the chart above? Is it Customer of something else?
