Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Thanks in advance!
Cheers,
Inês
I guess the alternative might be to do something like this:
Aggr(NODISTINCT Sum({$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value), Year_Month)
Try this:
Sum(TOTAL <Year_Month> {$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value)
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.
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)
I guess the alternative might be to do something like this:
Aggr(NODISTINCT Sum({$<Product=,Flag={'Sales'}, Source={'MySales'}>}Value), Year_Month)
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
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: