Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi Folks,
How to find the max value based on receipt date...
I want to show only max receiptdate of max unit price
 
Regards,
Sub2u444
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In front end You can do this by expression
=FirstSortedValue(distinct ReceiptDate, - aggr(max(UnitPrice),PartNo))
In script,
Data:
Load PartNo,
ReceiptDate,
UnitPrice
From Table;
left join
load max(UnitPrice) as MaxUnitPrice,
PartNo,
1 as MaxUnitPriceFlag
Resident Data
group by PartNo;
left join
load PartNo,
max(ReceiptDate) as MaxReceiptDate
resident Date
where MaxUnitPriceFlag=1
group by PartNo;
 
					
				
		
Hi,
I got like this..
I want the output like this..
| PartNo | ReceiptDate | Unit Price | 
| 1 | 15/03/2016 | 40 | 
| 2 | 15/05/2016 | 80 | 
| 10 | 01/08/2015 | 90 | 
Sub2u444
 
					
				
		
 avinashelite
		
			avinashelite
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks a lot its.anandrjs its was a typo error from me  
 
 
					
				
		
Hi Subbu,
Try to use the Aggr function and giving a sample Expression as Follows....
Aggr(if(Rank(Sum([Unit Price])<=1,ReceiptDate),ReceiptDate)
 
					
				
		
Hi,
Sorry, not getting the expected output..
getting like this..
Sub2u444
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try below expression
=FirstSortedValue(distinct UnitPrice, - aggr(max(ReceiptDate),PartNo))
or
FirstSortedValue(distinct UnitPrice, - ReceiptDate)
 
					
				
		
 avinashelite
		
			avinashelite
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try like this :
Max({<ReceiptDate={"=aggr(max(ReceiptDate),PartNo) ">}UnitPrice)
 
					
				
		
Hi,
not getting any data..
Sub2u444.
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Better if you create the Flag into load script.
Regards
Anand
 
					
				
		
 avinashelite
		
			avinashelite
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this 
=aggr(max(UnitPrice),PartNo)
