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

highest value with calculated dimension and suppress null

Hello all

I have a (straight) table with rides delivering packages and go from one City Hub to another. Each ride is devided in parts. At the end of the ride is the part of the ride that goes from a hub to the receiver: no City_to is filled. See first table below.

City_to can be forgotten and the date can be false (manually filled).

I want to have a straight table with one row of each ride, with a field that contains the latest date of the parts that have no City_to. (something like the 2nd table below)

Just choosing the youngest date is not enough: ride 1 would go wrong as obviously 4-8-2016 is a wrong date.

If two date are the same (e.g. ride 3), one of them is to be picked

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Dimension: Ride

Expression1: FirstSortedValue({<City_to={''}>} aggr(maxstring(City),Date_Leaving,Ride), -aggr(Date_Leaving,Ride,Date_Leaving))

Expression2: max({<City_to={''}>}Date_Leaving)


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
agomes1971
Specialist II
Specialist II

Hi,

please see the attached.

Regards

André Gomes

sunny_talwar

I am not sure I understand why 4-8-2016 is a wrong date here? Can you elaborate?

Gysbert_Wassenaar

Dimension: Ride

Expression1: FirstSortedValue({<City_to={''}>} aggr(maxstring(City),Date_Leaving,Ride), -aggr(Date_Leaving,Ride,Date_Leaving))

Expression2: max({<City_to={''}>}Date_Leaving)


talk is cheap, supply exceeds demand
raju_insights
Partner - Creator III
Partner - Creator III

Hi J Harke,

Capture.JPG

Is this what u r expecting ? If yes, PFA.

jharke
Creator
Creator
Author

Hello André,

In your file, Ride 1 is connected with date 4-8-2016. But as I already stated in my question: this date is incorrect (filled manually by a driver and he made a mistake by filling this date). The row for Ride 1 should be with City C and Date 3-8-2016.

jharke
Creator
Creator
Author

Goodafternoon Rangaraju,

It seems to be working, but I can only 'design' not 'develop': I cannot change anything in the script, only in the front / visualization part. So I would like to have a solution at the side of the user interface.

raju_insights
Partner - Creator III
Partner - Creator III

Hi J Harke,

solution at the side of user interface.

Capture1.JPG

gysbert wassenaar's suggestion would do the trick, PFA.