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

Aggr and Sum

I have a table with these columns:

SerialKey BRR_SerialNo BRR_State BRR_RetireDate BRR_City

1. if I create this expression:

BRR_SerialNo + BRR_State + BRR_RetireDate + BRR_City

it wont work.

But if I write:

Sum(BRR_SerialNo + BRR_State + BRR_RetireDate + BRR_City)

it works. Why?

2. If I create this calculated dimension:

Sum(BRR_SerialNo + BRR_State + BRR_RetireDate + BRR_City) or BRR_SerialNo + BRR_State + BRR_RetireDate + BRR_City

it wont work.

But if I write:

aggr(Sum(BRR_SerialNo + BRR_State + BRR_RetireDate + BRR_City))

it works. Why?

Thanks,

Miguel

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Reason 1:

          When you say Expression, it should also be at aggregated level and thus the fields with multiple values will not work in Expression without any Aggregation Functions.

     Reason 2:

          When you want to use the Aggregated values in Dimension, it should be used only with Aggr functions.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sebastiandperei
Specialist
Specialist

Hi Miguel,

Always remember, the expressions wil be calculated by each combination of related dimmentions you have in the object. In case that you don't have dimmentions, the expressions will be calculated for every selected data.

1. If you don't make an aggregation expression (like sum), QV doesn't know which value will be used for calculate the result. With Sum(), you are telling: take all related each one values of BRR_serialNo + BRR_State... and sum them.

2. What do you need to do? why do you use calculated dimmentions? You must think these kind of dimmentions like aggrupation of data, to show the expressions, not like expressions...

Not applicable
Author

I needed the first 3 columns to never move when I scroll right.

The way I've done it is using the first 3 columns as calculated dimensions and the rest as expressions.

Not applicable
Author

But this is a Raw table. I'm not doing any aggregation.

How come QV has to calculate any aggregation?