Posts

Tableau - save a modified data source

Image
When you change a data source and go to save it, Tableau by default gives you an option to save the workbook and NOT the data source. I was pretty annoyed with that. The right way to save the data source updates is Data - Connection - 'Add to saved data sources' And there you will get the options to save as a data source (tde) or a packaged data source(tdsx)

Tableau Column Difference - as a dimension

Image
I have got two types of values - 'Base' and 'CSA' in my data and I want to find the difference of those two values. Sounds simple right? Can you show that in Tableau? Think again. Yes you can!  Problem:   Googling gave me the solution to look for difference between columns and I got the difference but that was in a separate column. I wanted that in a row. Well, that essentially meant, I had to add a value in the dimension 'Valuation Profile'. How to do that? Asked this question on the tableau community and got my answer. Here is the original post.   Solution: Use LOD expression to calculate the individual values first. Create calculated fields 'BASE', 'CSA' and 'CSA-BASE' as below. BASE: {FIXED [Book Name]: SUM( if [Valuation Profile] = 'BASE' then Value else 0 end ) } CSA: {FIXED [Book Name]: SUM( if [Valuation Profile] = 'CSA' then Value else 0 end ) } CSA-BASE [CSA]-[BASE]

Tableau - How to sort the fields

Image
So apparently there are more than one ways to sort your fields. It took me at least two days until I realized and saw the two places. First one you simply google and find out that it is in the 'Default Properties' of the dimension. Simply click the arrow on the dimension, click 'Default Properties' and there is the sort option.  But even after clicking that, the columns were not getting sorted the way I wanted. So I kept searching and searching and one fine moment found this. It never occurred to me that the same pill in the column (in my case) section also can influence the order. So clicked there and voila, I found that it was sorted manually.  I hope this helps to newbies like me! Happy Tableauing.. :P

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.