Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
firmographs
Partner - Contributor III
Partner - Contributor III

Show dimension based on minimum measure

We have an table of Places and Distances, where the distance is the travel distance from various Offices to those Places.  

Table 1:  Offices

Office A

Office B

 

Table 2:  Office, Place, Distance 

Office A, Place 1, 5

Office A, Place 2, 15

Office B, Place 1, 6

Office B, Place 2, 12

 

Distance is calculated from every Office to every Place.  The table we want will have Office, the nearest Place, and min(Distance).  Only 1 row per Office.  

Office A, Place 1, 5

Office B, Place 1, 6

 

How can we approach this in Qlik?  Is it possible either in the load script or in creating a table with calculated dimensions?  

Labels (2)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

Table Dim : Office

Exp 1 (Place) : FirstSortedValue(Place, -Distance)

Exp 2 (Distance) : Min(Distance)

 

View solution in original post

3 Replies
msKarthikeyan
Employee
Employee

Hi, 

Should the output be 

Office A, Place 1, 5

Office B, Place 2, 12

or 

Office A, Place 1, 5

Office B, Place 1, 6 

-karthik

firmographs
Partner - Contributor III
Partner - Contributor III
Author

Karthik, you are correct thank you.  We want the closest Place to every office, and Place 1 is closest to every office.  I've updated the original post.  

tresesco
MVP
MVP

May be like:

Table Dim : Office

Exp 1 (Place) : FirstSortedValue(Place, -Distance)

Exp 2 (Distance) : Min(Distance)