Posts

Showing posts from April, 2017

Tableau - show value as 0 for No Data or Null

Image
Many times we come across this situation where two columns are being compared/subtracted/added etc. We must show a zero as people don't like blank. Blank technically does not mean zero but come to accounting/finance, people get confused. If there is no value, there has to be a zero so that when they download the Tableau report or export it to excel, there is a zero. Null means, there can be a problem in the data load and hence you don't see that value there. To remove the ambiguity, zero is needed. Here is how. The magic function is ZN (Zero Number). This will replace any null values with zero. If the number is null or empty zn function converts that null value to zero.If the number is not null  then tableau returns the same number. Lookup function will literally 'Look at' the specified column - in this case the same column (0) - and help replace null with zero. ZN(LOOKUP(SUM([Value]),0)) You can even correct the function right in the Measure Values pane. Yo...

Adding dynamic reference line for today/each day

Image
My project needed me to create a worksheet which will display the data loading batches each day. This essentially was a Gantt chart. The tricky part for me was to add a reference line - which would signify when the data load should start or end by. And every single day the reference line should move to show the current date.  Here are the steps. 1) Create Parameter 2) Create Calculated Field 3) Add reference line 1) Create Parameter Right-click in the Data pane and then select Create Parameter. Name the parameter "param_referenceLine". Under Data Type select 'Date'. Under Current Value, add today's date. Under Allowable values select All. Click OK. 2) Create Calculated Field Select Analysis > Create Calculated Field. Name the calculated field "Reference Line". In the formula field, enter the following formula: My deadline is that all the data loads should be complete by 7:00 AM so I will add 7 hours to the selec...

Refresh in Tableau Desktop - press F5

Well, at first I thought F5 would not work on desktop. After all it is refresh for web pages, isn't it? But guess what, that what it is for in Tableau Desktop and even for live connections!  I thought Tableau live connections are literally live but no. The connection is live the data is not. Let's say, you have a live connection to from your Tableau Desktop to some database and you create your visualization with filters and all. Now while Tableau Desktop is still open, if there is a new entry in the database, it won't appear in the visualization. Why? because Tableau is a query based tool; not a live streaming tool. A Live Connection means that Tableau sends queries to your database, and retrieves data. Generally, these queries will return whatever data is currently in the database; with one important exception – any data currently in Tableau’s cache. So just to summarize this for quick read. 1) Connect to any database with live connection. 2) Create Visualiza...

How to check performance of a view on Tableau Server

Image
Tableau Server Performance Recorder Open view for which you want to record performance. URL: Tableau appends ":iid=<n>" after the URL. This is session ID. e.g. http://<tableau_server>/#/views/WorkbookName/WorksheetName?:iid=1 Type  :record_performance=yes&  at the end of the view URL, immediately before the session ID. http://<tableau_server>/#/views/WorkbookName/WorksheetName? :record_performance=yes& : iid=1 'Performance' option is available in the view.

How to check performance of Tableau Desktop

Image
Tableau Desktop Performance Recorder Help -> Settings and Performance -> Start Performance Recording Help -> Settings and Performance -> Stop Performance Recording A new dashboard window opens up giving you a performance summary. It involves Timeline, Events Sorted by Time and the Query executed. 

Ideal Tableau Dashboards

Image
I found this White Paper   by Alan Eldridge which lists best practices for designing efficient tableau workbooks. In the paper itself it reads, that it's too long but that's necessary. I am creating these short notes for myself and you so that we can have a handy list of 'What' to do. I am not going to write 'Why' as you can read that in the paper.  If it is slow in the data source, it will be slow in Tableau Desktop/Server If it is slow in Tableau Desktop, it will (almost always) be slow in Tableau Server Keep upgrading your Tableau versions. Newer is better. Performance Recorder Tableau Desktop: Help -> Settings and Performance -> Start Performance Recording Tableau Server:  Open view for which you want to record performance. URL: Tableau appends ":iid=<n>" after the URL. This is session ID. e.g. http://<tableau_server>/#/views/WorkbookName/WorksheetName?:iid=1 Type :record_performance=yes& at the end of the vie...

Tableau Server - reports are loading very slow

Image
The first problem of the Tableau server is that it is slower than the desktop version. Which kind of makes sense but still business users don't like it. Developers are happy as they don't much have to deal with the server version for the reports; they can simply fire up their Tableau Desktop and get the information quickly. But once deployed on the server, the performance degrades. Reports load slow. You keep seeing the loading icon and eventually get tired of it. Well, there are few things you can do. I am simply going to write down one by one, as they occur to me. Clear the cache of the Tableau Server Simple and straight forward. Don't ask me why right now but just do it. Start TabAdmin Stop the Tableau Server Service  Clear the Cache. Start the Tableau Server Service.  Easy enough to say but how to do these steps? Here you go. The first step to using tabadmin is to open a command prompt as an administrator: Go to Tableau server Bin folder. c...

Landing

Recently one of my friends told me about Tableau product that seamlessly does the graphical analytics for you. I simply downloaded the latest trial version and boom, I was immediately hooked to that. In this blog, I simply wanted to share my learnings and also my troubleshooting I did to make it available for me for future reference. I also hope, people with similar problems would find it helpful. Cheers!