Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
skyline01
Creator
Creator

Qlik Sense Top N with drillable dimension

I am working in Qlik Sense 3.2 Enterprise (hence, no qvf attached).  I have only one table in my data model.  The table's columns are:

TransactionID

Amount

VendorID

VendorName

Manager

I have attached my data.


All columns are populated for every row.  TransactionID is my primary key.  In general (though possibly not in my attached data), VendorID has a one-to-many relationship with VendorName, and VendorID has a many-to-many relationship with Manager.

I need to create a bar chart of Sum(Amount) versus a drillable dimension of VendorName \ Manager for the top ten vendors (by VendorID).  It is permissible to display a "random" VendorName for each of these ten vendors (e.g., display the first associated VendorName encountered for each VendorID).  I have created the given drillable dimension as a master dimension.  My measure definition is:

If(

     Aggr(Rank(Sum(Amount)), VendorID) <= 10

    ,Sum(Amount)

     ,Null()

)

I am getting two unexpected results / behavior.  One, instead of the top ten vendors, I only see nine vendors.  Two, when I drill the dimension, I am getting an incomplete set of Managers returned for each VendorName.  There are no ties in the data (i.e., there are unique sums of Amount for each VendorID), and there are more than ten vendors in the data.

I'm not sure what I'm doing wrong.  I suspect that it's being caused by the one-to-many and many-to-many relationships in my data.  How can I resolve these two issues?

4 Replies
isingh30
Specialist
Specialist

Please share your data or app.

Thank you!

skyline01
Creator
Creator
Author

As noted above, I can't share my app (because I am working in Enterprise).  However, my data is attached to my original posting.

jerryyang756
Creator
Creator

Hi casey,

You are getting only top 9 because 'other' is enabled . Disable it. Please Check my attached application.

skyline01
Creator
Creator
Author

Hi Pritam,

I am not identifying my top 10 vendors the same as you.  As noted above, there is a one-to-many relationship between VendorID and VendorName.  So, the top 10 identification has to be done by VendorID, not by VendorName.  Hence, I am not able to implement the top 10 identification in the chart simply by the 'Limitation' option for the drill-down dimension.  As far as I know, it has to be done in the measure definition.  Still, though, VendorName is what needs to appear at the top tier of the drill-down dimension.