Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

priyash92
New Contributor III

Bar chart -Indexing all values against a fixed one in dimension

Hey Guys,

I am creating a bar chart and trying to achieve a relative indexing among the values in a dimension

Schema attached

Here I want a Bar Chart in which

Y Axis is  Sum(Clicks)

X Axis is : S_Name

And the Individual Bars are : X, Y and Z (i.e.all possible values in the D_Name column)

However instead of just Sum(Clicks) and having 3 bars per S_Name in their absolute form, I was looking for indexing X and Z based on value of Y :

Sum(clicks)

/

Sum({$<D_NAME={'Y'}>}clicks)

This is something I would imagine but obviously this fails to create bars for X and Z and just creates a bar for D_NAME = Y

I tried using the AGGR function after reading online but wasn't successfull.

Another approach I see here is crosstabing the dimensions D_NAME as a measure and then calculating across rows, but that is certainly not an option in my use case.

Can someone help me. (Schema of Data Attached)

5 Replies
MVP
MVP

Re: Bar chart -Indexing all values against a fixed one in dimension

May be you need this

Expression

Sum(Clicks)/Sum(TOTAL <D_Name> Clicks)

Dimensions

D_Name

S_Name

priyash92
New Contributor III

Re: Bar chart -Indexing all values against a fixed one in dimension

Doing

Sum(TOTAL {$<D_NAME={'Y'}>} clicks)

Total up the d_name = y across different S_Names

I want the corresponding value of D_Name= y only for that particular S_Name

priyash92
New Contributor III

Re: Bar chart -Indexing all values against a fixed one in dimension

Doing Sum(TOTAL {$<D_NAME={'Y'}>} clicks) would sum up the total of D_NAME =  Y Across all the S_NAMES, but I want the sum D_NAME = Y only for that particular S_NAME in the row.

MVP
MVP

Re: Bar chart -Indexing all values against a fixed one in dimension

Not sure I follow, would you be able to share a sample?

priyash92
New Contributor III

Re: Bar chart -Indexing all values against a fixed one in dimension

Hey Sunny,

I think i didnt explain it correct, my bad.

The alternative that I was able to do was create 2 difference metrics

One with

Sum({$<D_NAME='Y'>}clicks)/Sum({$<D_NAME='X'>}clicks)

and the other one is

Sum({$<D_NAME='X'>}clicks)/Sum({$<D_NAME='X'>}clicks)

In this way the 2nd one is always 1
and the 1st one is indexed against the 2nd one.

Thanks for all your help