Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Error in expression

So I'm trying to get a variable of average worked days.
The formula I'm currently using in the pivot tables is Cycle3_stop - Cycle1_start - Count({<nome = {'Attività non lavorative'}>} distinct assign_date) and it works.
I've tried to set that variable with Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date))) but I get an error in expression.

Any ideas what might be wrong or how can I calculate the average in a variable with a better expression? 

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

May be just this?

Avg({<nome = {'Attività non lavorative'}>} distinct assign_date)


Or, you have to put a dimension with aggr() against which you want the aggregation to work, like:


Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date) , YourDimension))

View solution in original post

3 Replies
Highlighted
MVP
MVP

May be just this?

Avg({<nome = {'Attività non lavorative'}>} distinct assign_date)


Or, you have to put a dimension with aggr() against which you want the aggregation to work, like:


Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date) , YourDimension))

View solution in original post

Highlighted
Master II
Master II

Hi,

you can try like below,

count(aggr(avg({$<nome = {'Attività non lavorative'}>} distinct assign_date),Dimension1, Dimension2))


p.s: remember to update dimension 1 & 2

also check this article,

Average – Which average?

If still not working share your mock data and expected output. tks

Highlighted
Creator II
Creator II

Thanks, I forgot to add the dimension on which I need the aggregation to work