Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expressions with different dimensions in same chart

Hello everbody,

I wanted to know if it is possible in a line chart to have two expressions with different dimensions ?

Common dimensions : Period

1st expression : average of marks by period and by country

2nd expression : average of marks by period for all countries

Thank you

13 Replies
Not applicable
Author

Hi!

Well, you can achieve that particular effect by making having Period as dimension and then add an expression for each country and an expression for all the countries.

Example:

Expression 1

avg( {<Country{"USA"}>} Marks)

Expression 2

avg( {<Country{"UK"}>} Marks)

Expression 2

avg( {<Country{"*"}>} Marks)

This will show a line for each country and an average for all the countries.

Hope it help!

/Regards

Not applicable
Author

The problem is that I got numerous lines...

masha-ecraft
Partner - Creator
Partner - Creator

You can try the following:

Chart dimension: Period

1st expression: Avg(Marks)

2nd expression: avg(aggr(avg(Marks),Period, Country))

/Masha

Not applicable
Author

I got something very strange :

impr2.bmp

masha-ecraft
Partner - Creator
Partner - Creator

Please add Period dimension to the list of aggregate parameters:

avg(aggr(avg(Marks),Period, Country))

Not applicable
Author

I tried but it still not working. I don't have my average by country but a global line...

impr3.bmp

Not applicable
Author

Hi,

Could you add an example where your solution is working? I would appreciate it alot since it would be neat to reduce the hardcoding

/regards

masha-ecraft
Partner - Creator
Partner - Creator

Do you need one line for each country and one line showing global average?

In this case you should have 2 dimensions: Period and Country, and your expressions should be like that:

Global average: avg({<Country>} Mark)

Average by country: avg(Mark)

Not applicable
Author

It overlaps lines.

impr5.bmp