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

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

Show Last Customer for a stock item, but make it a filterable dimension

Hi!  I have a client request to show a table of info about stock items.  One of the things they want to see is the last transaction date, The last customer, and the Qty of that transaction.

I can easily get all these by using the FirstSortedValue function, but the trick is they want to be able to click on the customer to filter the app for that customer to review their activity.

I have tried a few variations of AGGR but can't seem to get this to work.  My latest attempt is to use this dimension expression:

=Aggr(Maxstring(
Aggr(
    FirstSortedValue(Customer,-Date+rand())
        ,StockItem))
,Customer)
 
This shows an extra line with a blank in this field.  Also, if you click on the customer it selects a different one.  Very odd behavior.  For reference, here is a simple load statement to illustrate the issue:
 
Sales:
Load * inline [
Date,Customer,StockItem,Amount
1/1/2024,ABC,W1,10
5/1/2024,ABC,W1,11
2/1/2024,DEF,W1,12
6/1/2024,DEF,W1,13
];
 
It seems like this might be a common request, but I can't find a solution anywhere.
Labels (2)
0 Replies