Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
mihai_iov
Contributor 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? 

Tags (3)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Error in expression

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

Re: Error in expression

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
devarasu07
Honored Contributor II

Re: Error in expression

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
mihai_iov
Contributor II

Re: Error in expression

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