7 Replies Latest reply: Jul 20, 2017 2:22 AM by Rasmus Nielsen RSS

    Reduction of expression

    Rasmus Nielsen

      Hello guys,

       

      Pretty new to Qlik and I was wondering how the following expression might be reduce to a simpler form?

       

      (Avg({$<fillingDate={">=$(=Date(today()-365,'YYYY-MM-DD'))"}, paymentType={"Private"}, productName={"Euro 95"}>}ppriceRefPrice) - Avg({$<fillingDate={">=$(=Date(today()-365,'YYYY-MM-DD'))"}, paymentType={"Private"}, productName={"Euro 95"}>}ppriceEur)) * 100

       

      The point is that when retrieving ppriceRefPrice and ppriceEur, then they are limited to a interval of the last 365 days, payment type must be "Private" and productName must be "Euro 95". The final result is (avg(ppriceRefPrice) - avg(ppriceEur)) * 100.

       

      Can this be written in a more readable form?

       

      Thanks!