Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
jarkkotesi
New Contributor

Get latest value from table

Hi!

I have 3 columns on a straight table:

=YearMonth

=Transaktio_taloustieto_item

=Sum({<Transaktio_taloustieto_mittari_sarja={'Actual'},Transaktio_taloustieto_item={'Net sales 2018 estimate'}>}Transaktio_talotieto_amount)


This returns to me the following data:


sales.png


I would like it to return me only the last amount entered ( in this case Nr 1.) My goal is to have this formula added to a chart as a bar that has a yearly dimension. but it should only show the latest value inside that year.


Any ideas how to accomplish this?  




Tags (1)
2 Replies

Re: Get latest value from table

May be this

Dimension

Transaktio_taloustieto_item

Expression

FirstSortedValue(DISTINCT Aggr(Sum({<Transaktio_taloustieto_mittari_sarja={'Actual'},Transaktio_taloustieto_item={'Net sales 2018 estimate'}>}Transaktio_talotieto_amount), Transaktio_taloustieto_item, YearMonth), -YearMonth))

jarkkotesi
New Contributor

Re: Get latest value from table

Thanks Sunny,

It works when the dimenstion is set to Transaktio_taloustieto_item. But im using a combo chart, and the only dimension is  Year. Can you think of any way how to get it working in a combo chart, so that it would show the last value entered ?

Example:

If 2016 Q1=1, q2=4, Q3=3, Q4= empty, it should show 3 as for the year 2016 value.