Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a chart with 1 dimension - Country
And 4 expressions that represent count of particular application types
sum(if([Application TypeCode]='G',1,0))
sum(if([Application TypeCode]='L',1,0))
sum(if([Application TypeCode]='M',1,0))
sum(if([Application TypeCode]='O',1,0))
My chart looks like this
I need to create a Stocked Bar chart where each bar will be 100%. I have read post regarding stocked charts but can not figure how would I deal with 4 expressions.
Any help will be greatly appretiated
Yury
You should be able to divide each expression by the total value for that dimension. If each expression is divided by the total, they combined should equal 100% of that total.
sum(if([Application TypeCode]='G',1,0))/sum(1)
Also, try Set Analysis:
sum({<[Application TypeCode]={'G'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
That second one should be faster and more accurate if values other than G, L, M or O exist in the dataset.
You should be able to divide each expression by the total value for that dimension. If each expression is divided by the total, they combined should equal 100% of that total.
sum(if([Application TypeCode]='G',1,0))/sum(1)
Also, try Set Analysis:
sum({<[Application TypeCode]={'G'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
That second one should be faster and more accurate if values other than G, L, M or O exist in the dataset.
Not sure, where do I enter this new last expression, instaed of each of mine?
No, that last expression would replace your first one. Then use that as the basis for your second one, but replace the G. Basically, make each of your expressions like that one.
sum({<[Application TypeCode]={'G'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
sum({<[Application TypeCode]={'L'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
sum({<[Application TypeCode]={'M'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
sum({<[Application TypeCode]={'O'}>} 1)/
sum({<[Application TypeCode]={'G','L','M','O'}>} 1)
Use each of those as an expression and you should get what you are looking for.