5 Replies Latest reply: Jan 25, 2018 11:31 PM by Priyash shahane

# 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)

• ###### 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

• ###### 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

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

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

• ###### 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.