Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Club and Display two dimension values into one

Hi all, I have a table containing multiple columns and I am displaying a graph based on two columns, Attributes and Values. There are five attributes (A , B, C, D and E ) and I am showing a simple bar graph of values for each of them. I have set Attributes as dimension and sum(value) as expression. My requirement is to not display all attributes separately as five bars but instead A and B clubbed into one bar called AB, C will remain as such and finally D and E combined into a bar called DE. Just three bars as final. I tried creating calculated dimensions but I am unable to, Can someone help me here?

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

O I forgot to mention that you should remove the Attribute as a dimension. You are "replacing" the dimension with multiple expressions.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

7 Replies
Highlighted
Partner
Partner

A fast solution to your problem is to define one expression per calculation requirement in your chart.

SUM({$<Attribute = {'A','B'}>}Value)

SUM({$<Attribute = {'C'}>}Value)

SUM({$<Attribute = {'D','E'}>}Value)

Vegar Lie Arntsen

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Not applicable

I tried this Let's say I just add the first expression, I still get two bars. I need just one bar having the sum of both..

Highlighted
Partner
Partner

At properties, style, subtype choose stacked bars.

Highlighted
Partner
Partner

O I forgot to mention that you should remove the Attribute as a dimension. You are "replacing" the dimension with multiple expressions.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

Not applicable

Thanks this works but is there a better solution? I just provided a sample question and in the real application the graph as two more expressions depending on the same dimension.

Is there a way I can create dimensions for clubbing?

Highlighted
Partner
Partner

I would have created a new dimension in my script where I assign my transactions to my dimensions. There are several ways to do it, but the most fool proof is to use a mapping table.

My_map:

MAPPING LOAD * INLINE [

OrigDim, NewDim

A, AB

B, AB

C, C

D, DE

E, DE

]

Trans:

LOAD

     *,

     ApplyMap('My_map', OrigDim, null() ) as NewDimension

FROM ... ;

//Vegar

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Not applicable

Thank you Vegar, I will explore this solution.