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

Excluding one dimension from total

I have a table splitting my data according to two dimensions, one being the year of a payment, the second being a calculated dimension that splits the payment into £500 bandings.

I then show a count of the number of individuals in each payment banding for each year.

I would like to add a final column showing the total number of individuals each year, without segmenting by payment banding.

So far I have managed to use a set expression (see table for syntax) to show the total number of individuals overall, but not segmented by year.  I also think that my set expression will cause filters not to work.  How can I amend my set expression to exclude one dimension, but not the other?

Hopefully this all makes sense.  I'm fairly new to Qlikview.

£500Income BandsTax Year Ended=sum(Active)sum( {1} total Active)
0 <= x < 500201210825
500 <= x < 100020125825
1000 <= x < 150020122825
1500 <= x < 200020121825
2000 <= x < 250020121825
3000 <= x < 350020121825
0 <= x < 500201312825
500 <= x < 100020133825
1000 <= x < 150020134825
1500 <= x < 200020132825
2000 <= x < 250020131825
0 <= x < 500201410825
500 <= x < 100020144825
1500 <= x < 200020145825
2000 <= x < 250020141825
2500 <= x < 300020141825
3000 <= x < 350020141825
5 Replies
swuehl
MVP
MVP

You can add a field list to your total qualifier to achieve what you want:

=sum(total<[Tax Year Ended]> Active)

or

=sum({1} total<[Tax Year Ended] Active)

to disregard any selections.

Not applicable
Author

Thanks

Trying the above gave me the following (applied to slightly different data):

£500 BandsTax Year EndedSum (Active)=sum({1} total<[Tax Year Ended]> Active)
3000 <= x < 3500201111
2000 <= x < 2500201111
1000 <= x < 1500201111
500 <= x < 1000201111
0 <= x < 500201266
-500 <= x < 0201255
-1000 <= x < -500201233
-1500 <= x < -1000201211


To be clear about what I'm aiming for, I want the total by year in the last column (i.e. 4 for all of the 2011 rows and 15 for all of the 2012 rows).

I think the problem is that I'm trying to exclude the £500 banding, which is a dimension, not a selection.  Any help would be hugely appreciated.

Thanks


John

swuehl
MVP
MVP

I think I have understood your requirements.

I assumed [Tax Year Ended] is your actually field name, not the label you may have given to the dimension, right?

As said, you can add a field list to the total qualifier, it won't work with a label etc.

Not applicable
Author

Tax Year Ended is an actual field name.

"£500 bands" is a label for a calculated dimension based on the following class expression:

=CLASS(AGGR(Sum (if([Movement Type]='Repayments', [Amount])), [Tax Year Ended], [Individual ID]),[Repayment Bandings])

Does that help?

swuehl
MVP
MVP

Interesting. I now can reproduce your issue.

Please try

=aggr(NODISTINCT sum(TOTAL<[Tax Year Ended]> Active), [Tax Year Ended])

as expression.