Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

100% stack bar chart

Hi All,

I am working on creating 100 % stack bar chart.

i have selected dimensions as week and category

category includes

IF (Aggr(Sum(AMOUNT_CLIENT), [CLIENT],[YEAR],[WEEK]) < 10, 'Spender 1')

this if conditions different types of spenders.

my measure has count(distinct client)

value wise data is displayed fine but i want to convert the value into % (100 % stack bar chart)

can some one pls suggest .

22 Replies

May be try an expression like this:

Count(DISTINCT client)/Count(DISTINCT TOTAL <WEEK> client)

Contributor III
Contributor III


Thanks for your support. But when i tried this i am getting 400%.

You have Week as your first dimension, right?

Contributor III
Contributor III

yes. I have week has the first dimension.

Your second dimension has only one value?

If(Aggr(Sum(AMOUNT_CLIENT), [CLIENT],[YEAR],[WEEK]) < 10, 'Spender 1')

Nothing for when the condition is not met? Could that be the reason? I can't really say much without seeing what you have today? Can you share a sample?

Contributor III
Contributor III

I Have multiple if statements which follows as spender 3, spender 4 , spender 5...

Can you create a straight table with Week and your calculated dimension as your dimensions and two expressions

1) Count(DISTINCT client)

2) Count(DISTINCT TOTAL <WEEK> client)

Can you check if the second expression is totaling your Count of distinct client over any particular week?

Contributor III
Contributor III

both the expression are giving out same values

Contributor III
Contributor III

In your example. when i am selecting 2015, i am getting max of year that is 2016

Note : i have this expression as dimension as i am using bucketting.

and in the measure i am using

Count(({1<WEEK={"<=$(=Max({<Year = {$(=Max(Year))}>}WEEK))"}, Year = {$(=Max(Year))}>} DISTINCT CLIENT)