Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart with set analysis for max(year)

Hi All,

I'm trying to create a chart expression to calculate sales over each month for max selected year. The expression I'm working on is:

sum({< Year = {$(=Max(Year))>} Amount)

but it shows no value. Could you please tell what needs to be changed?

Thank you,

Przemek

6 Replies
tresesco
MVP
MVP

Hi, you are missing a "}"

correct expression: Sum({< Year = {$(=Max(Year))}>} Amount)

Regards, tresesco

Not applicable
Author

Indeed, I missed it, but the issue seems to be somewhere else - still not working.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

the only way for us to find an issue "somewhere else" is to see it. If you can post an example, we could possibly examine it...

Not applicable
Author

Attached. Hopefully it'll be helpful.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, I can see a couple of problems:

1. Your Set Analysis condition had a few syntax errors - missing "=" signs, misplaced brackets, etc... The correct equasion is this:

Sum({< Rok={$(=Max(Rok))}>} Kwota)

2. In your data, you have absolutely identical values of Kwota, with positive and negative signs, so the total sum of Kwota is always equal to zero. You can only see it if you select specific values of Kwota. It's caused either by the nature of your data (zero-sum accounts?), or by the way you generated your sample data.

if you correct those two problems, you'll see monthly numbers in your chart.

afsarshaikh
Creator
Creator

Store Max(Year) in a variable lets's say,

Varaible name = vYear

Varaible Description = =Max(Year)


So, your expression should be:

sum({< Year = {$(=vYear)}>} Amount)


Hope this works!

Regards,
Afsar Shaikh
Project Manager- QlikView Dev. & Support
Afsar Shaikh
Email- afsar.shaikh@live.com