Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vinicius_siquei
Partner - Contributor III
Partner - Contributor III

Calculating Average of an Expression

Folks, I need the Help to calculate the Following:

  • I have the Number of Consumables used by a company per month
  • I Have the Number of Equipments bought on a Company

The first thing I needed to calculate was:

     Consumables from Max Month or selection / Sum (Equipments bought on last 3 months)

     Having sep/14 as an example:

          Consumables Sep  /  Equipments Sep, Aug, Jul

               = Sum({$<DateId = {"$(vMaxData)"}>} Suprimentos) / Sum({$<DateId = {">=$(vDataDeslocada)"}>} Equipamentos)

     So far, it was Ok.

Then we came to the point I really have a Doubt:

     I need the average of this expression from the past 3 months

     Like calculating the expression for September, August and July and have their average.

     I tried something like this, but it doesn't work.

     = RangeAvg(Above(Aggr((Sum({$<DateId = {"$(vMaxData)"}>} Suprimentos) / Sum({$<DateId = {">=$(vDataDeslocada)"}>} Equipamentos)), Data),0,3))



I'm Attaching the example so you can help me:

1 Reply
rubenmarin

Hi Vinicius, check the attachment to see if that's what you are looking for.