Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Determing the associated values of a maximum

I have a column in a straight table in which I determine a maximum, using set analysis:

max({$<Rate-={}>} Sales)

In the second column I want to load the (minimum) value of 'Rate' associated with this maximum of Sales.

How can I do this?

1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

Does your table have a dimension?

Try somthing like this

=min({$<Sales={$(=max({$<Rate-={}>} Sales))}>} Rate)

Regards.

View solution in original post

2 Replies
pover
Luminary Alumni
Luminary Alumni

Does your table have a dimension?

Try somthing like this

=min({$<Sales={$(=max({$<Rate-={}>} Sales))}>} Rate)

Regards.

rluciano1012
Contributor II
Contributor II

Hi, Karl, I'm trying to take your example here and apply it to my model.  I'm trying to get the highest/max sales day by location and then the sales date it occurred on.  The maximum Net Sales is working correctly, but I can't get it to pull in the SalesDate.  Here are the two expressions I'm using.

//TO GET THE MAXIMUM OR HIGHEST SALES AMOUNT

max({$<SalesDate-={}>} NetSales)

//TO GET THE SALES DATE THE MAXIMUM SALES AMOUNT OCCURED ON

max({$<NetSales={$(=max({$<SalesDate-={}>} NetSales))}>} SalesDate)

I've tried several different set analysis formulas to get the date and I can't seem to figure it out.  Does it have something to do with the date field?  The date format being used in the load scipts/tables is MM/DD/YYYY

Also, as you can see, I am using StoreName as my only dimension in this table.

StraightTableResult.jpg