Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two records with the same Vin number but only want to show the most recent date. If i eliminated Column "Type of Repair" then it'll eliminate the record that isn't the Max Date. However, now I have a two different attributes in Type of Repair Account.
Status | Car Vin | Job Description | Comments | Drop Off Date | Type of Repair |
In Shop | 82000917 | Oil Change | 2022-09-30 | Drop off | |
In Shop | 82000917 | Oil Change | 2022-06-01 | Unplanned |
Currently this is my script for Drop off Date.
=Date(Aggr(Max(TOTAL [Drop Off Date]),[Car Vin],[Drop Off Date]),'YYYY-MM-DD')
What script would i need for Type of Repair to only show
Status | Car Vin | Job Description | Comments | Drop Off Date | Type of Repair |
In Shop | 82000917 | Oil Change | 2022-09-30 | Drop off |
no script necessary for Drop Off Date, just the field is enough. Try this for Type Of Repair (and untick 'Include null values' tick box)
if(aggr(max(date([Drop Off Date],'DD/MM/YYYY')),"Car Vin")=[Drop Off Date],"Type of Repair")
Option1) Using Max()
Dimensions
Status
CarVin
JobDescription
Comments
DropOffDate = aggr(if(Max(DropOffDate)= Max(Total <CarVin> DropOffDate),DropOffDate) ,CarVin,DropOffDate) << Uncheck Include Null Values for this dimension
TypeOfRepair
OR
Option2) Using FirstSortedValue()
Dimensions
Status
CarVin
JobDescription
Comments
DropOffDate = aggr(FirstSortedValue( DropOffDate,-DropOffDate),CarVin) << Uncheck Include Null Values for this dimension
Measure
TypeOfRepair = FirstSortedValue(TypeofRepair,-DropOffDate)