Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.


Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.


average data

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

1 Reply

Re: average data

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))


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

See also

A Primer on Set Analysis

Dates in Set Analysis