Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Calculate Avg grouped by 2 dimensions

Hi, i need to obtein the average grouped by Period and Country like show the following table. Can you help me?

Thanks in advance

chart.PNG

1 Solution

Accepted Solutions
MVP
MVP

Calculate Avg grouped by 2 dimensions

It looks more like a percentage share of products number than an average value to me?

If this is what you want, I think the last column is calculated like

= sum(Products) / sum(total Products) *100

and the second last column like

= sum(Products) / sum(total<Period, Country> Products) * 100

in a table chart with Period, Country and Type as dimensions - wait that won't explain your two feb-11 / Spain / D lines, how do you separate these two lines? There seems to be some dimension missing here.

4 Replies
MVP
MVP

Re: Calculate Avg grouped by 2 dimensions

Hi,

it seems I have some problems reading your table. The last column is what you want to achieve?

In your sample data,  I would expect to see the same value for any given combination of Period and Country, if you want to group by these 2 dimensions.

It looks to me that your last column is an average grouped by 3 dimensions (Period, Country and Type or Products).

What is the field / value you want to average? If you could post some lines of raw data, this might help in finding a solution for you.

edit:

If you just want to give it a try:

=avg(total<Period, Country> Value)

Not applicable

Calculate Avg grouped by 2 dimensions

Hi swuehl, the last column is the normal average result. So it sum 100%, but i need the result of previous column: Avg (Period/Country) which sum 100% by each Period & Country.

Thanks for your attention

MVP
MVP

Calculate Avg grouped by 2 dimensions

It looks more like a percentage share of products number than an average value to me?

If this is what you want, I think the last column is calculated like

= sum(Products) / sum(total Products) *100

and the second last column like

= sum(Products) / sum(total<Period, Country> Products) * 100

in a table chart with Period, Country and Type as dimensions - wait that won't explain your two feb-11 / Spain / D lines, how do you separate these two lines? There seems to be some dimension missing here.

Not applicable

Re: Calculate Avg grouped by 2 dimensions

Thanks swuehl, your solution works fine !!

I'm sorry, the two feb-11 / Spain / D lines was a mistake when typing, one line would be C.

Community Browser