Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi,
I have a question, i have a data like this:
Menu Quantity GroupName
A 5 Group1
B 10 Group1
C 2 Group1
B 1 Group2
A 7 Group2
i want to show group name that has max quantity, Total quantity of group1 is 10+5+2 = 17 and Total of group2 is 1+7 = 8, So i want to show 'Group1' that has maximum total/sum quantity in a text Object. Can you show me the method ?
Thanks in advance.
 MayilVahanan
		
			MayilVahanan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
Try like this
=Concat(DISTINCT{<GroupName = {"=Sum(Quantity)=$(vMaxQuantity)"}>}GroupName,',')
where vMaxQuantity =Max(aggr(sum(Quantity), GroupName))
Hope it helps
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hi
can u attach the sample qvw..?
Thank you
Suresh
 MayilVahanan
		
			MayilVahanan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
Try like this
=FirstSortedValue(GroupName, - Quantity)
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In the textbox:
=FirstSortedValue(GroupName, -Aggr(Sum(Quantity),GroupName))
 
					
				
		
 sunilkumarqv
		
			sunilkumarqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try like this
=sum({<GroupName={'Group1'}>}Quantity)/sum(TOTAL Quantity)
 
					
				
		
Hi guys,
Thanks for all your help. But i have another problem, when there are two group that has same total quantity, let's say both Group1 and Group2 has total quantity 20. The result is -
Do you know why ?
Thanks
 MayilVahanan
		
			MayilVahanan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
If both values are same, then Firstsortedvalue shows null value.
In that case, which value you need to show in textbox?
 
					
				
		
Hi Mayil,
Is it possible to show both value, so the result will be 'Group1' and 'Group2'
thanks for your response 
 
					
				
		
 SatyaPaleti
		
			SatyaPaleti
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Indra,
Try with this
Max(aggr(sum(Quantity), GroupName))
Thank you,
Satya Paleti
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Just put Distinct like:
=FirstSortedValue(Distinct GroupName, -Aggr(Sum(Quantity),GroupName))
and don't worry about the synatx warning in red.
