cube icon indicating copy to clipboard operation
cube copied to clipboard

Tableau: CASE WHEN support for WHERE query section

Open svdimchenko opened this issue 2 years ago • 1 comments

Failed SQL

ERROR: Error during rewrite: Can't detect Cube query and it may be not supported yet. Please check logs for additional information. QUERY: SELECT "backoffice"."channel" AS "channel", MEASURE("backoffice"."active_users_approx") AS "usr:Calculation_227361445783511041:ok" FROM "public"."backoffice" AS "backoffice" WHERE (CASE WHEN (("backoffice"."brand" IN ('P1', 'P2', 'P3')) OR ("backoffice"."brand" IS NULL)) THEN false ELSE true END) GROUP BY 1

the problem is with this where condition which is generated by tableau:

WHERE (CASE WHEN (("backoffice"."brand" IN ('P1', 'P2', 'P3')) OR ("backoffice"."brand" IS NULL)) THEN false ELSE true END)

Version: 0.34.41

Additional context I run into such issue when I connect tableau to cubejs. The issue can be reproduced in following way:

  1. Choose any measure from cube
  2. Choose any string dimension and put it as filter. IMPORTANT: to reproduce the issue you should not put the cube's dimension to tableau's group by.
  3. Select more than half of available values in filter. For instane, if you have 30 available values for the dimension, you should select at least 15 to reproduce the problem. When you choose 14 values, all work fine.
  4. Get the error mentioned above in the issue description.

svdimchenko avatar Jan 05 '24 16:01 svdimchenko

actually this is the final blocker for https://github.com/gr8-toolkit/cubejs-tableau-connector usage. Once this issue is fixed, we'll test the connector again, sign it and all the community will be able to use it in production

svdimchenko avatar Jan 08 '24 09:01 svdimchenko