2 Replies Latest reply: Jan 25, 2012 5:25 AM by andries Bos RSS

    chart: show the last price recorded and not the highest

    andries Bos

      I would like to show the last date registered for purchasing products and the latest price (not highest) connected to this product.

       

      I use  a chart where the fields shown are defined by: article  , max(DateofPurchase)  and price.  This will (as I filtered on latest date with the 'max') whos one record per article. However in this example the price wil be left blanc ( " - ").

       

      How could I get the attached latest price connected to this purchase date ?

       

      Source data:

      articledateprice
      10.011-1-201212,5
      10.015-1-201213
      10.0110-1-201210
      11.501-1-201210
      11.504-1-201211
      11.5012-1-201212

       

      My chart should show the last purchase date (and this date's price).

       

      Chart Result:

      articledateprice
      10.0110-1-201210
      11.5012-1-201212

      If I use max(price) , i will receive this maximum price (e.g. 13 for article 10.01 ), but this is not what i want : i'm looking for the price at the last date. Maybe somethin like =last(price)

       

      maybe using a filter like   =( { < Date = {$(Max(Date))} > }  would help, but somehow this syntax is not correct?

       

      Update : Adding the max value (although I just expected one answer)

      max ( {< Datum={$(=Max(Datum))} >}  Laatste_Prijs)   dit provide me with the correct answer... 

       

      Update 2: this solution will only work when filtering to one article, not wile showing a list of distinct articles.