Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mattphillip
Creator II
Creator II

Relabelling Class Function Groups

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

13 Replies
JonnyPoole
Former Employee
Former Employee

can you post a screenshot before and after please ?

mattphillip
Creator II
Creator II
Author

See attached.

M

JonnyPoole
Former Employee
Former Employee

i suppose you could wrap it in a  If(  not Isnull()   )  condition to only render if its a legitimate grouping.  I'm not sure where that group comes from though if the regular class() didn't yield such a bucket. If i were to guess, there may be  NULLs in the data model that show up with this methodology (but not with class() )  and we now have to manually suppress them.

=

if( not isnull(left( Class( Age, 10), findoneof( Class( Age, 10),' ',1)) ),

left( Class(Age, 10), findoneof( Class( Age, 10),' ',1))

& ' to ' &

( Num(mid( Class( Age, 10), findoneof( Class( Age, 10),' ',4)))-1)

)

You may need to 'suppress nulls' on the dimension tab properties too. not sure becuase i don't get this result with my test data to test against.

mattphillip
Creator II
Creator II
Author

Thanks Jonathan. It works! Much appreciated for all the support.

Matt

--

Matt Phillip

Academic Administration Officer (Strategic Planning)

Planning Office

Abertay University

The University of Abertay Dundee is a charity registered in Scotland, No: SC016040