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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show year only when it is max of sales for that year

Hi Folks

I have a chart that shows the sales value for the year with the highest sales as follows:

Max ( Aggr ( Sum ( SalesValue ) , CompanyName , SalesYear )

How would I include the year as a dimension in this table? If I simply include the year then of course it's going to show me all years. If I use the following:

IF ( Sum(SalesValue) = Max ( Aggr ( Sum ( SalesValue ) , CompanyName , SalesYear ) , SalesYear )

I get an "Error in Calculation", any suggestions as to what I could do here?

1 Reply
Not applicable
Author

One more ')' required?

IF ( Sum(SalesValue) = Max ( Aggr ( Sum ( SalesValue ) , CompanyName , SalesYear ) ), SalesYear )

A similyar expression works for me.

--Arun