Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reverse FirstSortedValue NOt WOrking (0!!! Questions resolved to date)

I can run the First Sorted Value in Order and retrieve the First Value but when placing a negative sign in front of my expression to try to retriev the Last Sorted value in the List it does not return anything when it should resolve a value.

FirstSortedValue(aggr(sum({<Inv={"=sum({<VehicleGroupName={'DimensionName'}>}aggr(exp(sum(log(1+Value1)))-1, VehicleGroupName,Inv))

  <  

(exp( SUM( TOTAL<VehicleGroupName, BusinessDate>  aggr(log(1+SUM({<VehicleGroupName={'DimensionName'}>}PValue2)

    /SUM({<VehicleGroupName={'DimensionName'}>}PValue3))

, VehicleGroupName, BusinessDate)))-1)"

}>}

aggr(exp(sum(log(1+Value1)))-1,Instrument)),Inv)

,-(aggr(exp( sum(log(1+Value1)))-1,Inv))

)

2 Replies
swuehl
MVP
MVP

Please note (taken from the HELP), that

If more than one value of expression share the same lowest sort-order, the function will return null.

Could this be the case? Try using the DISTINCT qualifier with the FirstSortedValue() function to force QV to return at least something.

Not applicable
Author

This was niot the case - but thank I already resolved it