Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling up Averages

Hey guys,

Got a problem around a two-stage calculation.

People and parties. How many followers do they have on Twitter? I get Follower Data at a Tweet level (important).

SO:

maxstring(followers)

gives me a correct calculation for one person's followers.

BUT:

How do I roll that up to a party level? At the moment it is being distorted by the number of tweets a user sends. For example, if person A has 100 followers and person B has 10 followers, the average should be 55.

BUT if person B tweets 10 times and person A tweets once, the average is 10*(10 followers) + 1*(100 followers) = 200 followers, divided by (10+1)=11 tweets. So the average comes out at 18.

Can anyone help?

1 Reply
Gysbert_Wassenaar

Maybe something like this: avg(aggr( count(followers) * count(tweets),party))

If not, please post a qlikview document with enough data to calculate some correct results.


talk is cheap, supply exceeds demand