Skip to main content

Hi Tableau Experts,

 

I have a calculated field in Tableau that returns a string value, for example, ‘(MIN([Criteria1]) AND MIN([Criteria2])) OR COUNTD([ClientID])>5’. This is just an example, the real one is longer and more complex and dynamic, so it doesn't have any regular structure/pattern.

That string is calculated using multiple String Parameters - for example: '('+Parameter1 +'AND'+ Parameter2 +')'+'OR' + Parameter3 (again, just an example).

Is it possible to convert this text field into Tableau calculation:  MIN([Criteria1]) AND MIN([Criteria2]) OR COUNTD([ClientID])>5 given the syntaxis and the field names are correct and return the value?

And is it possible to do it without too much hassle like, for example, searching for 'SUM' and then use SUM() function, etc. - just grabbing the whole string and make it a calculated field?

I know I probably want too much, but maybe there is a super-cool and smart way of doing this that I couldn't think about.

 

Another way would be to try and pass it to Custom SQL, but it’s not ideal, as I’d like to use Tableau Extract and also it looks like we can pass the parameters, but not calculated fields :/

 

Any ideas?

답변 3개
  1. 2019년 9월 19일 오전 5:59

    Yes, that's not possible. What you are looking for may work with scripting languages like Shell Scripts/PL-SQL where you can form the Dynamic SQL statement and get them executed in the database.

0/9000