Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 thanhphongle
		
			thanhphongle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hello community,
i need to know how i can give out the max/min from a column.
example
| Product | Cost | 
|---|---|
| A | 100 | 
| B | 200 | 
| C | 300 | 
| D | 400 | 
| E | 500 | 
If i choose product D it should compare the Cost of product D (400) with the other product's cost and finaly give out the minimum cost which is 100. something like this:
if Product D = 400 -> compare cost with other products -> give out min cost
could anyone please help me out here?
i know that there s an expression for max/min like max(Cost), but it does not make the comparison which i want to see.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try using total
min(total Cost)
 thanhphongle
		
			thanhphongle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		it does not work. it still gives me out D 400 if i select product d.
in fact it should work like this
i select from the product list - Product D
in the first chart it should give me out - Cost=400
in the second chart it should compare the cost of product D with the other costs and give me out the lowest cost - min cost=100
 thanhphongle
		
			thanhphongle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		it gives me out product D's cost = 400 and min(cost)=400 if i select product D in my list
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this:
Min({<Product = >} TOTAL Cost)
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
 thanhphongle
		
			thanhphongle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		it works! thank you very much!!
 
					
				
		
If it's correct, close the post and assing the correct answer to the user who help you 
 thanhphongle
		
			thanhphongle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I still have another question.
now it gives me out correctly the min(Cost)=100. but can i combine it with another expression which gives me the product name of min(cost)=100
sth like this:
i select product d, Cost product D=400 , give me out min cost with the expression Min({<Product = >} TOTAL Cost) , and now give me out the referring product to the min(cost) which is product A in this excample.
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this:
=Only({<Product = >} If(Cost = Min({<Product = >} TOTAL Cost), Product)
=Only(TOTAL{<Product = >} If(Cost = Min({<Product = >} TOTAL Cost), Product)) (Correct expression)
PFA the application also
Best,
Sunny
