Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

labels for subtotals?

I am new to Qlikview and I am hoping this is an easy thing.

I am creating a pivot table with sub totals based on the year dimension. 

What I would like to show is the year that is being aggregated to show up as the label for the subtotal combined with a text.

So when I show the total for year 2003, I would like for the label to show "2003 Total" and the 2004 to show "2004 Total".

Is that possible?

Thanks!

15 Replies
a_mullick
Creator III
Creator III

Thanks for looking Bill.

Attached is a simple example with a label defined for the sub-total over finMonth:

Azam

Not applicable
Author

Hi,

If it is a variable (ex: vYear) you can reference in the expression and it will work even nothing is selected.

Gysbert is right all subtotals for one dimension have same value.

a_mullick
Creator III
Creator III

Hi Ebolluca,

Can you be more specific please? What goes in the variable, and how is that variable used in the 'Label for Totals' field?

Thanks,

Azam

Not applicable
Author

Hi Azam,

Since labels for totals and dimensions will have identical values you can either type variable value as static or calculate it in script.

Here is a example from Script:

..

Let vYearTotalLabel = 'Y' & right(Year(Today()), 2)& '-Y' & right(Year(Today())+4, 2);
..

This will generate variable = Y2013 - Y2017

In the label of subtotal place following

=vYearTotalLabel

or anything like

=vYearTotalLabel & ' Total'

Best,

Ersen

Not applicable
Author

Hi

I have a similar situation

I want each subtotal to have data of the group they are inserted in.

The thing is: when I have a selection, the subtotal is properly labeled with the expression ="Total " & [Group Name]

But when  I remove the selection, then all my subtotal labels are set to "Total". I imagine this to be due to the fact that in the deselected state, there are multiple values of [Group Name], while in the selected state, there is one value for [Group Name] (ICMS, in the case below)

How can I print the [Group Name] in every subtotal label?

Below are my printscreen exemples (without the expression column)

Thanks

Screen Shot 2014-07-18 at 5.02.58 PM.pngScreen Shot 2014-07-18 at 5.02.23 PM.png

a_mullick
Creator III
Creator III

Hi,

If you haven't had a look look already, then as Gysbert says, Breakdown of Total instead of just the total, gives a good work-around for most cases.

Thanks,

Azam