Some useful Get() functions in Qlikview

Space is always an issue when it comes to design. How do you solve it? I typically take two approaches, multiple sheets or hidden objects driven by selections. For this post we are going to look at hidden objects using some built in Qlikview functions. I built a demo dashboard to show some of the functionality I am talking about.

 This is a bit more cluttered than I typically like, and a couple of the charts are not something I would use in an actual dashboard (like Gauge Charts, which I find to be particularly worthless). It’s a pretty standard layout, Key Performance Indicators on the top, and supporting charts in the body. I’ve used 3 of the GET() functions in this document:

and this one for good measure: DocumentTitle()

By selecting a different field in the Cycle button for the group a different set of charts will show.
Basically this main bar chart drives what we see on the rest of the page. I did this using a Dimensional Group as well as the GetCurrentField() Function.Each time you hit the cycle button The Group I created contains fields for Office, Territory and SalesPerson.  The idea here of course is that each click reveals some additional detail about each dimension. For example, cycling to the Office field shows the dashboard as we see it above. But if you cycle to Territory you see this view:
As you can see the top right chart has become a Block Chart (I prefer these to Pie Charts) showing the types of Companies who have made purchases. If you Cycle again, to SalesPerson You see this view: which changes the block chart to a share of Sales Status. How did I achieve this using GetCurrentField()? It’s really simple actually. I took the expression and went into each charts Layout tab, and made the Show a Conditional one. The syntax of the code is GetCurrentField([GROUPNAME])='[FIELD]', so for this particular view you can see my code looked like this GetCurrentField(Cycle1)='SalesPerson'. 

Just like any other document I allow users to filter by clicking in the charts on the screen. I prefer to do this typically, rather than using a multibox filter or a series of list boxes. It makes things simpler and flow in a more intuitive manner (not to say I don’t use filter boxes I definitely do, but when I can keep it simple, I keep it simple).  I figured that a Manager when looking at this view:

Might want to see the list of Companies in the pipeline so I used GetSelectedCount() within the bottom line charts Show/Conditional to reveal another layer:

Actually I am going to correct myself, this method requires Show/Conditionals in both charts affected. The Line Chart has this piece of code GetSelectedCount(Date)=0 while the Grid Chart has this GetSelectedCount(Date)=1. All I am doing here is saying, if you click on a single date, then you see the list of Customers for that date. If no date is selected, then you see the line chart.

There are two other places I use GET() functions, and both are in the same part of the document. I’ve made both parts of my templates as I’ve continued working in Qlikview. The first is DocumentTitle() This simple little function takes the document name and displays it. The document title is found under Settings>Document Properties. I simply take this and display it in a text box like this: Quite Often I have multiple sheets in the documents as well, and I want to display the sheet name. Initially I thought, there must be a place to enter a Sheet Title, similar to the Document Title, there is, but there is no SheetTitle() function. So I use the GetActiveSheetId() function. and inside the sheet properties, I change the default ID to something useful (this helps later if you are using variables to navigate to pages as well, but we can talk about that another time).

 Above I changed SH01 to the word Overview. It was not as simple as throwing the GetActiveSheetId() into a text box though, I needed one extra step, because GetActiveSheetId() brings back text like this: DOCUMENT\Overview. Who wants that DOCUMENT\ showing? Looks like crap. So I used another function to Parse out the piece I wanted, like this:
The End result looks as you have seen it in the other screenshots.
You are probably saying to yourself, “That’s cool, but I think I can just write in what I want the titles to be”. You are right, you certainly can. The advantage here is in using the Documents Properties, and Object/Sheet IDs and naming them useful things can help you later on in the process, when you are exploring things in the document. An object name SH01 means nothing, but if you name it SalesShare then you will know what the chart actually is. Believe me, when you have a ton of charts hiding and showing in a document, it’s very important to be able to easily identify them.

Anyway, these are some simple, and I think pretty common uses of a couple of GET() functions. Hope it was helpful.

Some useful Get() functions in Qlikview