Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zach_paz
Contributor III
Contributor III

Using expressions from one chart as a fields to aggregate in another chart... Help!

Hi all,

I am trying to sum an expression in one chart in another chart. For example, in the chart below 'prediction' is an expression and 'geoid' and 'geoid_2' are dimensions.

geoid   geoid_2   prediction

123     123          5

123     124          2

123     125          3

124     123          2

124     124          6

124     125          7

I want to use the value in the 'prediction' column to sum for geoid '123'.

Needed output:

geoid  sum(prediction)

123    10

124    15

Is this possible? I have been trying to use variables but can't get it to work.

Thanks in advance!

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's not possible to reference an expression column in another chart. You need to repeat whatever expression created the value. You may need to use an aggr() function if the expression needs to be calculated using a different granularity. For example, let's say "prediction" is calculated as "avg(score)" across the geoid + geoid_2 dimensions. To get the sum of those values in your new chart, which has only a geoid dimension:

-sum( aggr(avg(score), geoid, geoid2))

-Rob

http://masterssummit.com