2 Replies Latest reply: Sep 6, 2017 12:50 PM by Jarkko Pelli RSS

    Get latest value from table

    Jarkko Pelli

      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?  




        • Re: Get latest value from table
          Sunny Talwar

          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))

            • Re: Get latest value from table
              Jarkko Pelli

              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.