Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

sum total regardless of selection

Hi All,

Cost Centre Sub Cost Centre Amount

10000 10000_XX 500

10000 10000_XY 500

10000 10000_XZ 500

20000 20000_XX 500

20000 20000_XY 500

20000 20000_XZ 500

Given a table like the above I need to add a column that will give me the total of Cost Centre for each line the cost centre appears on so for the above I would have 1500 for each line of 10000.

But there's a catch! I know I could use aggr to do this, however, there are other selections in list boxes external to this straight table that could restrict the list so that e.g. only 10000 sub cost centres XX and XY would appear, I need the column to still show 1500, I've found using aggr the total changes to 1000.

I've tried using set analysis but can't get it to work - this is what I tried:

=sum(total {$<[Cost Centre] = {[Cost Centre}>} Amount)

Please help!

Thanks.

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Not applicable

sum total regardless of selection

sum({1} total <[Cost Centre] > Amount)

View solution in original post

3 Replies
Highlighted
Not applicable

sum total regardless of selection

sum({1} total <[Cost Centre] > Amount)

View solution in original post

Highlighted
Not applicable

sum total regardless of selection

Thanks Richy. That nearly works, it gives me the total regarless of selection but when you select a cost centre it removes the Amounts from other rows but the rows remain? Thanks

Highlighted
Not applicable

sum total regardless of selection

I found the problem, added a simple if statement to fix it:

=

if(sum(Amount)=0,0,sum({1} total <[Cost Centre]> Amount))

Thanks again.