0

Hello Tableau experts!

I'm fairly new to Tableau and I'm currently working on a report with a connection to an OLAP cube. However, I'm getting some strange performance with some of the calculated measures that I have created.

My query at this point is very basic - I've got the order number in there, which is the lowest level of granularity and I'm filtering the data by the entry date of the current date. I've then got one measure in there, this being the net price and in total the query returns about 200 results.

I then create a calculated measure with the following formula:

   CASE sign([Price Net]) when 1 then 1 else 0 end

When I then bring it into the report, it works fine and is returning the correct value in seconds. I then create the following formula, which essentially returns the same value:

   IF [Price Net] <=0 then 1 else 0 end

However, the performance on this calculated field is extremely poor - it actually just ran out of memory trying to run it. Its almost as if the second formula is querying the whole cube rather than the filters dictated in the query, as opposed to the first query that just works on the filtered records.

Is there anything that we should be aware of when creating calculated measures in Tableau on a cube? I can't really see much different between the two calculations?

My experience of creating calculated measures off flat datasources would suggest that the calculation should work fine!

Thanks

2 Answers2

0

It's very weird indeed, I believe CASE is a less efficient routine than a simple if in most applications. I have no idea how both this routines are designed in Tableau, but perhaps working with sign([something]) is easier than [something] itself, as sign([something]) has only 3 possible values. It's not because the result is the same that the computer is doing the same thing.

By the way, drop the CASE, use sign([Price Net]) directly as your measure, it should save some more memory and time to process

Inox
  • 2,255
  • 3
  • 13
  • 26
  • Thanks for the response - at lease I'm not doing anything obviously wrong! FYI - The sign query does what I want, but I think I'm also going to want to write more complex if's so might have to rethink this. We could calculate the measure in the cube, but to be honest I'd expect tableau to be able to measures of this nature in the front end :( – user3485250 Apr 03 '14 at 08:10
  • Totally agree. Don't want to rush into conclusions before I fully explore this tool. I have no idea how the data sources are structured in Tableau, but the calculated fields disappointed me a little, in terms of performance and limitations (the latter could be due my ignorance so far). Calculations that are not window calculations (and therefore give the same results regardless of what view you're using) should be calculated once and stored as values in the database (and recalculated only when the base is updated). This should boost performance a little – Inox Apr 03 '14 at 12:39
0

I know I'm a little late to the game, here, but for those who are connecting Tableau to OLAP data sources, it's pretty important that you understand the Tableau limitations described in this document

This white paper elaborates some of the issues.

Takeaway lesson: Connecting Tableau to a an OLAP source trades off query speed against flexibility and ease of implementation: many calculated measures that can be created on-the-fly when connected to a relational source must be implemented in the cube itself, or using MDX, which reduces the Tableau Report's draggy-droppy ease of use for non-technical business users.

Curt
  • 5,518
  • 1
  • 21
  • 35