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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum only first month selected

Hi All,

I'm trying to do a sum with a chart, but can't seem to find the right solution

I want to set the Month to something like Month = first selected Month.

Did try the following, but somehow the month is not selected correctly.

Sum(If(MES=MIN(MES),QTYAVAILUM))

Anyone got suggestions??

thx

Marcela

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Where do you want to use this expression? What are your dimensions? Is MES field of numerical type?

You could give this a try:

= sum({<MES = {$(=min(MES))}>} QTYAVAILUM)

Regards,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

Where do you want to use this expression? What are your dimensions? Is MES field of numerical type?

You could give this a try:

= sum({<MES = {$(=min(MES))}>} QTYAVAILUM)

Regards,

Stefan

Not applicable
Author

Thanks swuehl,

That works!!!!

swuehl
MVP
MVP

I think the problem in your original expression is that you are using an aggregation function (min) within an aggregation function (sum), which will not work. You should get an error in expression dialog, right?

You could use a dollar sign expansion like

Sum(If(MES=$(=MIN(MES)),QTYAVAILUM))

to overcome this, here, I believe Min(MES) will be evaluated in global context (also in the set expression above).

Not applicable
Author

You're right, i'm new in this...

That works too, thnks!