Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Custom Labels in Pivot Table

Hi all

I've an issue and I need your help! I need to custom the subtotal labels of a pivot table. Imagine a pivot table with 3 dimensions and, for example, the third dimension has two subtotal labels. By default those 2 would have the same name but I need to have different names according to my needs...

I already try an expression like: if(Dimension 2='X', 'Total 1', 'Total2')

The QV always enter in the else part no matter the condition...

There's another way of doing that?

Thanks in advance.

Kind regards,

TMF

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Data:

LOAD * inline [

Dimension1, Dimension2, Value

A, X, 10

A, Y, 15

A, Z, 23

B, X, 32

B, Y, 54

B, Z, 12

C, F, 43

D, G, 24

];

CustomTotals:

LOAD distinct

      Dimension1,

      Dimension2,

      Dimension2 as Dimension2WithTotals

Resident Data;

Concatenate(CustomTotals)

LOAD distinct

      Dimension1,

      Dimension2,

      pick(match(Dimension1, 'A', 'B')+1, 'SubTotals common', 'SubTotals for A', 'SubTotals for B') as Dimension2WithTotals

Resident Data;

View solution in original post

8 Replies
whiteline
Master II
Master II

Hi.

You could adopt this approach:

http://community.qlik.com/message/252646#252646

Not applicable
Author

Hi whiteline

Thanks for reply. However what I really need is to customize each subtotal label...

TMF

whiteline
Master II
Master II

You can customize all what you want with the approach mentioned above.

Not applicable
Author

Hi whiteline

Another time, thanks for answering me!

I can't see how... Can you post a sample file with 3/4 dimensions with the text of subtotals label customized? When I say customize I'm not refering to colors but with text. I want to be able to have a diferent text in each of my 10 subtotal lables...

For the record, I don't want to change the load script. So if there is a way of doing that with change it, I would appreciate.

Best regards,

TMF

whiteline
Master II
Master II

If you read the post carefuly you'll see that 'total' there is just another value of the new field that is used as dimension.

There is no magic, you just add the value that you want and connect it with all values of dimension.

You can use this approach for any number of dimensions separately.

For example, here the new field is used for months grouping:

http://community.qlik.com/message/255186#255186

Not applicable
Author

Hi whiteline

I re-read your post again very carefully and I can't find the solution for my problem. Maybe you don't understand my problem or I don't understand how to solve it with your solution.

Either way, if you can post a sample file with subtotal labels customized would be very nice

Kind regards,

TMF

Not applicable
Author

Hi

I'm in a hurry... Does anyone have another idea/solution?

Thanks in advance.

TMF

whiteline
Master II
Master II

Data:

LOAD * inline [

Dimension1, Dimension2, Value

A, X, 10

A, Y, 15

A, Z, 23

B, X, 32

B, Y, 54

B, Z, 12

C, F, 43

D, G, 24

];

CustomTotals:

LOAD distinct

      Dimension1,

      Dimension2,

      Dimension2 as Dimension2WithTotals

Resident Data;

Concatenate(CustomTotals)

LOAD distinct

      Dimension1,

      Dimension2,

      pick(match(Dimension1, 'A', 'B')+1, 'SubTotals common', 'SubTotals for A', 'SubTotals for B') as Dimension2WithTotals

Resident Data;