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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average expressions

hi ,

I have to calculate average for selected number of zones. If i select single zone it will display the correct value, but if i select two to three zones , it is not showing the correct value. Please help me with the expressions.

Thanks in advance

4 Replies
swuehl
MVP
MVP

It is hard to answer your request, because we don't know anything about the expression you are using, the data model, the context.

Could you post a small qvw sample file here to the forum? And your requested result?

Or some lines of your data as INLINE table?

Not applicable
Author

 

"Avg

({$< Year = {"<=$(#vYear)"}>}[ Annual Average]) "

where annual average values are  -28.91  -28.27 & 25.48

Answer should be -10.56 . But it is displaying -16.

swuehl
MVP
MVP

Have you checked the number of records that avg() uses, i.e. the frequency of your [Annual Average] values?

Try using

count({$< Year = {"<=$(#vYear)"}>}[ Annual Average])

Do you get 3 for your sample?

Not applicable
Author

Yes i did. I checked the frequency, Its more .

I used DISTINCT in the same expression & got correct answer. Thanks for your clue