Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display text label for expression in a bar chart

Newbie question here.  I have a simple bar chart that shows the use cases (dimension) by quarter/year.  I can successfully get the basics of the chart the way the user wants by using the year concatenated with quarter as my expression, but the expression labels then shows as '20171' for example whereas I would like to show it as 'Q1 2017'.  Is this possible?

7 Replies
sunny_talwar

Try this as the expression for label:

'Q' & Month(Date) & ' ' & Year(Date)

'Q' & Ceil(Month(Date)/3) & ' ' & Year(Date)

swuehl
MVP
MVP

='Q'& QuarterField & ' ' & YearField

Not applicable
Author

I must be doing something wrong as I tried that previously (and again now), and my chart just shows 'No data to display' when I use that as my expression.

Here's a visual of what I have and what I'm going for.

chart.png

sunny_talwar

May be try this as your calculated dimension instead of [use case]:

Dual('Q' & Right([use case], 1) & ' ' & Left([use case], 4), [use case])

swuehl
MVP
MVP

Missed that you are using an expression.

I don't think you will easily get a text representation at y-axis, but for mouse over, you can try

=Dual( 'Q'& QuarterField & ' ' & YearField, Makedate(YearField, QuarterField*3-2) )

swuehl
MVP
MVP

What should work is using a an expression that returns a date:

=Makedate(YearField, QuarterField*3-2)

Then set the number format in Number tab to date and use some format code like MMM YYYY

No format code for quarters, AFAIK.

Not applicable
Author

So it is pretty limited it appears.  Thanks swuehl, I will use your suggestions to get a little closer to what they wanted.