Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

last value in sub sum

Hi all,

i have a table with the stock values per month e.g.

monthstock value
1100
2120
3150
4160
5170
6100
790
8120
9130
10140
11120
1290
total1490

The problem is that the total amount will aggregate all the stock values of the year.

Is it possible to show only the last value in the total amount (90)?

Thanks in Advance

Best regards

Daniel

12 Replies
Nicole-Smith

See the expression in the attached.

javier_florian
Creator III
Creator III

Hi Daniel,

Can you try with...

=Sum({<YearMonth={$(vMaxYearMonth)}>} [stock value])

-JFlorian

Not applicable
Author

Hi Nicole,

thx for your answer, but the script doesn't work.

May be the supplier (second dimension) could be the problem.

Not applicable
Author

i tried it and lost the game

Nicole-Smith

Can you post an example of your chart then?  If we don't have the full information, it's hard to help...

Not applicable
Author

Hi Nicole,

supplierdepartmentproductgroupmonthstock value
testwomenshirts1100
testwomenshirts2120
testwomenshirts3150
testwomenshirts4160
testwomenshirts5170
testwomenshirts6100
testwomenshirts790
testwomenshirts8120
testwomenshirts9130
testwomenshirts10140
testwomenshirts11120
testwomenshirts1290
test total1490should be 90 stock value in month 12
testwomenjackets1200
testwomenjackets2300
testwomenjackets3400
testwomenjackets4500
testwomenjackets5300
testwomenjackets6200
testwomenjackets7300
testwomenjackets8400
testwomenjackets9500
testwomenjackets10600
testwomenjackets11300
testwomenjackets12200
testwomenjacketstotal 4200should be 200 stock value in month 12
testwomentotal 5690should be sum of women shirts and jackets 290
test menshirts 5690
test menshirts1200
test menshirts2300
test menshirts3400
test menshirts4500
test menshirts5300
test menshirts6200
test menshirts7300
test menshirts8400
test menshirts9500
test menshirts10600
test menshirts11300
test menshirts12200
testmenshirtstotal 4200should be 200 stock value in month 12
testtotal 9890should be the sum of all productgroups of month 12 (490)
Not applicable
Author

it is very hard sorry

richard
Partner - Creator
Partner - Creator

Daniel,

Is this a table loaded in your script or are you trying to get your result in an object?

Not applicable
Author

Hi Daniel,

Please check out the attached document.I created a straight table with the expressions you are looking for.

Hope it helps

Thanks

AJ