Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hoping someone can help. I've used the class function to group ages to produce a bar chart. However, the labels on the X axis are not very clear as to what they refer (e.g. 20 <= 21 < rather than 20 to 29.). The calculated dimension looks like this - =Class(Age,10,Age). I've seen where some have added text boxes to cover up the labels, but is there a way of actually customising the labels?
Any help would be much appreciated.
Matt
Dear Matt,
Use replace() function for replacing '<= x <' with 'to'.
=Replace(Class(Age,10),'<= x <', 'to')
Regards,
Kiran
Dear Matt,
Use replace() function for replacing '<= x <' with 'to'.
=Replace(Class(Age,10),'<= x <', 'to')
Regards,
Kiran
You can wrap the result in a replace() function to get what you want . Replace '<=x <' with something better like to
replace( Class(Age,10,Age) , '<= x <' , 'to')
Hi Matt,
Try using the Replace function, in the format:
Replace(Class(....), '<= x <', ' to ') - this should replace the standard text a class bin width uses with your "to".
hi have a look at the attach example
simple replace function will do the trick
Thanks Kiran (and everyone else too). Works a treat! The only thing I've noticed though is that age groupings overlap e.g. 20 to 30 (which doesn't feature anyone aged 30), 30 to 40 (which does feature those aged 30 but no one aged 40). Is there anyway to tweak this so there is no overlap e.g 20 to 29, 30 to 39?
Any help would be much appreciated.
Matt
I played around a bit more. Here is a full customization that seems to work. I'm doing a '-1' at the end of the 2nd value to reduce it by one notch. Does it help ?
=
left( Class( Sales, 1000), findoneof( Class( Sales, 1000),' ',1))
& ' to ' &
( Num(mid( Class( Sales, 1000), findoneof( Class( Sales, 1000),' ',4)))-1)
Perfect Jonathan! Works a treat Many thanks everyone!
Matt
Yes ! sorry i posted the example from my own data you are correct
everything else is right. the first space denotes the end of the first number, the 4th space denotes the start of the 2nd number...thats the key for the findoneof() function.
number <= x < 2ndnumber
Ah, one slight fly in the ointment. Whilst it has sorted the groupings, it now features an empty first grouping of <blank> to <blank> with no values. I'm assuming its trying to group 0-9. Is there an easy way of hiding this empty grouping?