Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
cleonice_liebl
Contributor
Contributor

Expandir Campos Tabela Dinâmica

Bom dia,

Para as tabelas dinâmicas do Qlik View é possível expandir e contrair dimensões nos eixos por valores únicos de campo. No Qlik sense tem apenas a opção de expandir  ou contrair tudo,. Alguém sabe se existe alguma forma de configurar para usar igual ao Qlik View?

Obrigada

Labels (3)
2 Replies
AustinSpivey
Partner - Creator
Partner - Creator

There's not an "out-of-the-box" way of doing this but you can get clever to get similar functionality.

One way to do this would be to use a variable, the Variable Input object, the If() function, and then CalcDim() function.

1. Create a new variable called vPivotToggle or similar:

AustinSpivey_0-1678472171840.png

 

2. Add a new Variable Input object to your sheet. Choose the vPivotToggle variable we just created, show it as buttons, and display them in a row:

AustinSpivey_1-1678472250567.png

 

Use fixed values for each dimension field in your pivot table where the Value is 1, 2, 3, etc. in the same order as in your pivot table and the Label is the dimension name, like so:

AustinSpivey_2-1678472407282.png

 

3. In your pivot table, update your dimension fields to use this expression:

=CalcDim(If( $(vPivotToggle) >= 2, Category))

This expression uses an If() function to check whether the value for that field has been selected in our Variable Input object. If it has, then we chow the field. Otherwise, null is returned (the null is implicit, since we don't provide an else condition here).

The CalcDim() function makes it so that selecting those dimension values means you are selecting the underlying field values rather than treating this as an on-the-fly field.

 

This should give us the desired result:

SO - Qlik Sense pivot table toggle 1.gif

 

Austin Spivey | Principal Consultant @ Arc Analytics
ArcAnalytics.us | Add me on LinkedIn
AustinSpivey
Partner - Creator
Partner - Creator

Sorry, I just realized that I misunderstood what you were asking. Here's a way you can address what you were actually talking about:

=CalcDim(Repeat(' ', FieldIndex('Region', Region)) & Category)

You can use the above expression to dynamically prepend spaces to the beginning of the [Category] values based on the each unique value of the [Region] field, in this case. It works because while those [Category] values are now each unique, they look the same in the pivot table because Qlik automatically trims those strings.

The result is thus:

SO - Qlik Sense pivot table toggle 2.gif

Austin Spivey | Principal Consultant @ Arc Analytics
ArcAnalytics.us | Add me on LinkedIn