Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
cgT
Creator
Creator

Data Aggregation Problem

Hi experts,

I'm having a problem with some data based around capacities in an auditorium.

I have a fixed capacity figure (pulled through from a spreadsheet, I'm using QS Enterprise) which is broken down into each level of the auditorium. Here is an example:

Performance Date & Time Capacity Part of House
29/04/24 19:30 713 Stalls
29/04/24 19:30 442 Dress Circle
29/04/24 19:30 372 Grand Circle

 

These are pulling through correctly. However, when I take out the 'Part of House' dimension, it appears to aggregate this numbers, like so:

Performance Date & Time Capacity
29/04/24 19:30 550.4589178

 

I was expecting this numbers to sum together, creating a total of 1,527. It appears that some sort of an aggregation is being applied, as though the 1,527 total is being divided by the number of Parts of House, however this doesn't add up either, as multiplying the 550.4589178 by 3 gives 1,651.38. 

Is anyone able to help me decipher what's going on please?

Many thanks,

Labels (1)
1 Solution

Accepted Solutions
cgT
Creator
Creator
Author

Thanks so much for this @Fabiano_Martino_Intelco ,

I've tweaked your script suggestion and used a Composite Key across the PoH, Venue and Show fields to get it to work correctly.

Your suggestion very much inspired me though, so thank you for your help.

View solution in original post

17 Replies
cgT
Creator
Creator
Author

And to add clarity, this expression is currently calculating the capacity down to the PoH level:

sum(Capacity)/count([Performance Date & Time])
Fabiano_Martino_Intelco
Partner - Creator II
Partner - Creator II

Hi @cgT 

that's odd.

If you create two separate expressions:

- sum(Capacity)

- count([Performance Date & Time])

what values do you get?

I suggest you test these expressions in both tables, to check if some values are not aligned.

Regards

cgT
Creator
Creator
Author

Hi @Fabi ,

Here is what I get if I remove the expression and just drop in the Capacity field, along with the count of PerfDate&Time:

Performance Date & Time Capacity Capacity count([Performance Date & Time])
29/04/24 19:30 550 549,358 998

 

TcnCunha_M
Creator III
Creator III

Sum(Aggr(Sum(Capacity), Performance Date & Time, Part of House))

As you think, so shall you become.
cgT
Creator
Creator
Author

This gives me a value of 1,815,599...

TcnCunha_M
Creator III
Creator III

so there some duplication on your data, try o add distinct 
Sum( distinct Aggr(Sum(Capacity), Performance Date & Time, Part of House))

As you think, so shall you become.
cgT
Creator
Creator
Author

The figure of 1,815,599 still remains...

TcnCunha_M
Creator III
Creator III

are there any Part of House Null ?

because check if  check " suppress when value is null", might be is courting now those values where if you have suppress null values doesn't count 
because the aggregation should solve your problem, i believe there something on  data model 

As you think, so shall you become.
TcnCunha_M
Creator III
Creator III

See this sample i did it

TcnCunha_M_0-1720012829372.png

 

As you think, so shall you become.