Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated dimensions?

Hello,

I have a chart with some data, but i need to convert that table in 3 tables, everyone with data from the respective type (without changing the selections).

In the bellow example i want to create 3 charts, one for the 'segmento' 1, other for the 'segmento' 2 and finaly another to 'segmento 3.

SegmentoFamiliaQtyPrice
1Bebidas5.1630,01
1Carne de Bovino39.9590,05
1Carne de Ovino8160,01
2Bebidas2.2730,01
2Carne de Bovino66.7940,06
2Carne de Ovino2090,01
3Bebidas3270,01
3Carne de Bovino1.1170,05
3Carne de Ovino690,00

My actual object/chart has to dimensions: 'Segmento' and 'Familia', i want to 'filter' the dimension 'Segmento' in order to show only data from just one 'Segmento' in each one of the charts, maybe use some calculated dimension like: { <[Segmento] = {1} >}.

So if, as in the above example, i have 3 'Segmentos' i'll do a chart (each one with its calculated dimension) for each one of the 'Segmentos', see the bellow example.

SegmentoFamiliaQtyPrice
1Bebidas5.1630,01
1Carne de Bovino39.9590,05
1Carne de Ovino8160,01
SegmentoFamiliaQtyPrice
2Bebidas2.2730,01
2Carne de Bovino66.7940,06
2Carne de Ovino2090,01
SegmentoFamiliaQtyPrice
3Bebidas3270,01
3Carne de Bovino1.1170,05
3Carne de Ovino690,00


Is this Possible?

Thank you,Joaquim

1 Solution

Accepted Solutions
swuehl
MVP
MVP

The other dimension values won't appear if suppress zero values is enabled on presentation tab.

You could also try a calculated dimension like

=if (Segmento=1,Segmento)

or

=aggr(if(Segmento=1,Segmento),Segmento)

or

=aggr(only({<Segmento={1}>} Segmento),Segmento)

and check Suppress When Value is Null on dimension tab.

View solution in original post

8 Replies
swuehl
MVP
MVP

Joaquim,

try using the set expression like { <[Segmento] = {1} >} in all your expressions, using aggregation functions.

E.g.

sum( { <[Segmento] = {1} >} Qty)

to create the first chart.

Hope this helps

Stefan

Not applicable
Author

Thank you Stephan.

That would be the obvious way, but that way the other segmentos would appear also but with 0 values.

Cumprimentos,

Joaquim Correia

Sistemas de Informação

Tel.: (351) 220 403 243 / 00 • Fax: (351) 229 022 107

Tlm.:(+351) 919 112 623 • e-mail: joaquim.correia@b2b-pt.com<mailto:luis.ferreira@b2b-pt.com>

De: swuehl

Enviada: quarta-feira, 25 de Janeiro de 2012 11:40

Para: B2B-Joaquim Correia (Informática)

Assunto: - Re: Calculated dimensions?

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Calculated dimensions?

created by swuehl<http://community.qlik.com/people/swuehl> in Development (QlikView Desktop) - View the full discussion<http://community.qlik.com/message/185449#185449

swuehl
MVP
MVP

The other dimension values won't appear if suppress zero values is enabled on presentation tab.

You could also try a calculated dimension like

=if (Segmento=1,Segmento)

or

=aggr(if(Segmento=1,Segmento),Segmento)

or

=aggr(only({<Segmento={1}>} Segmento),Segmento)

and check Suppress When Value is Null on dimension tab.

stephencredmond
Partner - Specialist II
Partner - Specialist II

In the Dimension, you can simply do a calculation:

   =if(Segmento=1, Segmento, Null())

Then supress Null for the dimension.

Regards,

Stephen

Not applicable
Author

In the Used Dimensions, Add the following "Calculated Dimension"

   =if(Segmento=1, Segmento)

Then on the "Setting for Selected dimensions" area,  Check the button "Suppress when value is Null"

Kind Regards.

Not applicable
Author

Thank you Quentin.

It was it.

Cumprimentos,

Joaquim Correia

De: Quentin Richard

Enviada: quarta-feira, 25 de Janeiro de 2012 13:06

Para: B2B-Joaquim Correia (Informática)

Assunto: - Re: Calculated dimensions?

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Calculated dimensions?

created by Quentin Richard<http://community.qlik.com/people/biteguebiessono> in Development (QlikView Desktop) - View the full discussion<http://community.qlik.com/message/185480#185480

Not applicable
Author

Thank You Stephen.

Cumprimentos,

Joaquim Correia

De: Stephen Redmond

Enviada: quarta-feira, 25 de Janeiro de 2012 12:34

Para: B2B-Joaquim Correia (Informática)

Assunto: - Re: Calculated dimensions?

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Calculated dimensions?

created by Stephen Redmond<http://community.qlik.com/people/stephen.redmond> in Development (QlikView Desktop) - View the full discussion<http://community.qlik.com/message/185477#185477

Not applicable
Author

Thank you Swuehl.

Cumprimentos,

Joaquim Correia

De: swuehl

Enviada: quarta-feira, 25 de Janeiro de 2012 12:24

Para: B2B-Joaquim Correia (Informática)

Assunto: - Re: Calculated dimensions?

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Calculated dimensions?

created by swuehl<http://community.qlik.com/people/swuehl> in Development (QlikView Desktop) - View the full discussion<http://community.qlik.com/message/185474#185474