Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qvqfqlik
Creator
Creator

average data

I want to calculate data which would be average for present week. how to achieve this ?

1 Reply
swuehl
MVP
MVP

Either use Avg() function or aggregate your measure and divide by e.g. number of distinct dates in your period:

Average – Which average?

If you want to limit the data to the present week, either use a conditional function or set analysis:

=Avg( If( DateField >= Weekstart(Today()) and DateField <= Weekend(Today()), ValueField))

or

Avg({<DateField  = {">=$(=Date(Weekstart(Today())))<=$(=Date(Weekend(Today())))"} >} ValueField)

See also

A Primer on Set Analysis

Dates in Set Analysis