# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for
Did you mean:
Partner

## Total in all rows

Hi all,

I have this table in Qlik Sense:

And I am using the following expression for last column:

sum(Aggr(Sum({\$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value),Year_Month))

I get the total (I want the total of the first column - 859 709 705.56) on the total aggr column, but I want this value to be shown in all rows. Because basically I will need to divide the first column values by this last value.

Does anybody know how to do this?

Cheers,

Inês

1 Solution

Accepted Solutions
MVP

I guess the alternative might be to do something like this:

Aggr(NODISTINCT Sum({\$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value), Year_Month)

6 Replies
MVP

Try this:

Sum(TOTAL <Year_Month> {\$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value)

Partner
Author

Unfortunately that does not work because if I do that, it will somehow not consider the Year_Month... and it will give me the totals for ALL months.

MVP

I am not sure why it wouldn't consider Year_Month if we specifically gave the field name Year_Month in the total qualifier? Are you sure you added this?

Sum(TOTAL <Year_Month> {\$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value)

MVP

I guess the alternative might be to do something like this:

Aggr(NODISTINCT Sum({\$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value), Year_Month)

Partner
Author

I did, I also don't understand why the first option is not working...

But it worked with the NODISTINCT could you please explain me how exactly it works?

Once again, Thank you so much!!

Inês

MVP

When you used only one dimension from your chart within your Aggr() function, there is a grain mis-match. And when this happens, the value is assigned to just one of the rows instead of getting populated all rows. By adding NODISTINCT you can ask Aggr() to populate those values on all rows. Read some more about this here:

Pitfalls of the Aggr function

Tags
Community Browser