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 calculation not correct

Hi Qlikview developers,

I need some help to see what is going one here...

I have a pretty simple datamodel (to isolate the problem) and a .qvw in which I try to explain what I think is very strange... I hope someone of you can explain me what is going on...

This is my case

- I have Bookings and articles (1 - N)

- I want to show in a gauge (or textbox for this purpose) the average total price per booking

- when I calculate this with avg(aggr(sum(Prijs),Reserveringnummer)) this gives another outcome than Sum(Prijs) / count(distinct Reserveringnummer)

I can't explain that, since in this case it should produce the same outcome in my qvw (all articles belong to 1 reservering)

It becomes even stranger: when I do not load my master-calendar... the avg(aggr(sum(Prijs),Reserveringnummer))  expression _suddenly_ does give the right result...

I hope someone can show me what I'm overlooking (or can confirm that this seems to be a bug?)

I hope my attached QVW is clear enough. Let me know if there are any further questions.

Thanks in advance!

14 Replies
Not applicable
Author

Hehe thanks for sharing this finding.

Strange indeed (...).

whiteline
Master II
Master II

If you create the chart mentioned above and uncheck 'Supress Zero-values' and 'Suppress missing' you'll see that 'strange null' row.

upd:

Also it's something strange with %Datum key field. The screen is attached.

Not applicable
Author

Indeed seems strange (the %Date field in your screenshot), although I don't seem to do very special things...?

In the attached QVW I made the table you suggested. The strange thing that I now discovered is that

- the expression total is "correct"

- the caption of this chart is incorrect

>>The caption and the total are both derived from one and the same expression...

See the .qvw and the screenshot attached to this post.

whiteline wrote:

If you create the chart mentioned above and uncheck 'Supress Zero-values' and 'Suppress missing' you'll see that 'strange null' row.

Sorry, I tried to make this "strange null row" visible, but I couldn't. As visible attached, those 2 checkboxes are unchecked (dimensions tab). What else should I do to make that one visible?

whiteline
Master II
Master II

The checkboxes on presentation tab are checked.

Uncheck them (See the screenshot).

The totals is correct, because these checkboxes filter the data set.

The expression for caption is calculated without that filter, so it includes that null values.

Not applicable
Author

Thanks, now i found them (the right ones). I only knew from suppress null-values from the dimensions tab. Good to know.