Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using the following function to make a histogram :aggr(class(count(distinct Month),3),[All Codes])
When my class width is 1, my categories start from 1 (i.e. 1<=x<2), but when I set my class width as 3 as in the formula above, it unhelpfully starts from zero (.e. 0<=x<3). How can I make it so that my first category is 1<=x<4?
Many thanks,
Isabel
Have you tried using the offset parameter to class() function?
aggr(class(count(distinct Month),3, 'x', 1 ),[All Codes])
Have you tried using the offset parameter to class() function?
aggr(class(count(distinct Month),3, 'x', 1 ),[All Codes])
That works a dream - thank you
Hi,
Is it possible to also cap the expression, so I have 7+ as one category? Dimension limits want to work of the value in the category, rather that the category its self!
Many thank,
Isabel
Maybe like this:
aggr(if(count(distinct Month)<7,class(count(distinct Month),3, 'x', 1 ), dual('7+',7) ) ,[All Codes])
And another question that your experience may help with:
Do you have any tips on how to make this into a % graph, so like a mecca but with the same column widths? I would normally divide by the sum of the category total but I can't see how I'd code in the category total since it is not a defined field!
Thanks for your help, I really appreciate it,
Isabel
This worked perfectly too - I'm so pleased. Thanks for your quick responses!
Isabel
Not sure if I understood your % graph request correctly.
What is your current expression in the chart? Something like
=count(distinct [All Codes])
?
Then try
=count(distinct [All Codes]) / count(total distinct [All codes])
If you are using a second dimension, Category, then you can add this to the total field list:
=count(distinct [All Codes]) / count(total<Category> distinct [All codes])
And format this expression as percentage on number tab.