Captions on charts and tables are quite useful in QlikView, the colouring of the caption can denote currently selected objects and the caption provides an anchor to pick up and move objects by.  If you are going to have captions then you should at least use them well.  How?  Read on..

When you first create your chart, setting only the bare essentials up first, your caption may look a bit like this one here.

Expression Only

The actual coding behind the expression is shown in the header (which is meaningless to anyone who is not a developer) and there is some chart junk in the form of maximize and minimize icons that you probably don’t need.

First of all, you should always provide a label for any expressions, whether that label is visible or not, that is meaningful to the user.  Any icons that are not required can be turned off.  The XL icon is a matter of taste – I tend to leave it on.

Labelled Expression

But why stop there?  You have space taken up by a caption, so why not use it?  In the caption you can type plain text, or (more usefully) you can provide an expression.  Expressions always start with an equals sign.  If you are showing numbers then ensure that you use the num function to format them correctly.  In this example total sales are shown.

With Value

Your chart or table will no doubt have a dimension on it, so you can also use the space to give details of what the dimension is that the chart is over.  If your chart or table uses a Cycle group then you can use the GetCurrentField function to retrieve the current value.

Dimension And Value

If you still have some room on your caption bar you could provide even more information here.  It may be useful to show the date range of the data that you are displaying or, as I have here, a count of the rows of data that make up the values in the chart. You can do all kinds of expressions in a caption so give some thought as to what is going to be most useful to your users.

Finished Chart

Here is a completed chart.  The caption is showing additional data in the form of the total sales (which you would have to add up otherwise) and the number of sales – which is not represented at all.  If the dimension wasn’t a Cycle group then you could do away with the dimension legend on the chart and only have it in the caption.  In the image above the caption text is restating the dimension in the caption, so that all the headline information is in one place.

The code required for the caption bar in the chart above is as follows:

=’Sales by ‘ & GetCurrentField([SalesCycle]) &
‘ (£’ & num(sum([Sales Amount]), ‘#,##0’) & ‘ – ‘ &
num(sum(RowCount), ‘#,##0’) & ‘ Sales)’

As well as captions; expressions built up in this way can be shown in Text Objects.  A ticker bar of information along the top of a page is a good way of getting lots of information in to a small amount of space.

So, what can you fit into the captions in your apps?