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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
heiko_schmidt
Contributor III
Contributor III

Problems with Range AVG

Hello everybody, I am facing some problems with Rangeavg sheet function.(or maybe there is another way to achive the desired result)

To explain my problem i put together some example Data.

my Real Data has more dimensions to take care of.

load * inline
[
Date,Value
1,2
2,5
3,8
4,10
5,1
6,5
7,8
8,5
];

In a straight table i use Sum({<Date={">3"}>*<Date={"<=7"}>}Value) to only display and calculate the values where date is greater than 3 and less or equal to 7.

so the result is a table like that:

Date      Sum

TOTAL   23

4              10

5              1

6             5

7              8

Now what i need is a third column with the average of this range and the result should look like this:

Date      Sum       RangeAVG

TOTAL   24

4              10            6

5              1              6

6              5              6

7              8              6

 

Any suggestions ?

 

Best regads

Heiko

 

Labels (3)
1 Reply
sunny_talwar

Try this

Sum(TOTAL {<Date = {">3<=7"}>} Value)/
Count(DISTINCT TOTAL {<Date = {">3<=7"}>} Date)