forums
Use these forums to ask questions and discuss Tableau.
Excel and Pass Through Functions (RAWSQL)
Posted August 13th, 2008 by Joseph DAnna
in Calculations
Is it possible to use Pass Through Functions (RAWSQL) with a connection to Excel?
This would be very handy for expanding the function base for calculated fields to include Excel functions like MEDIAN, PERCENTILE, etc.
For example, knowing Excel doesn't speak SQL but hoping it would work anyway, I tried"
RAWSQL_REAL("median(%1)",[my_data_column])
The function parser declared it OK... but when I tried to put my new field on a shelf I got the message
"Database error 0x80040E14: Undefined function 'median' in expression."
Comments
Unfortunately the RAWSQL functions only work with databases that understand SQL. You can't use the RAWSQL functions with Excel, Access, or Text files. The work around would be for you to create the column in your Excel file before connecting with Tableau.
Isn't it possible to create and extract from an excel source file and use that for performing RAWSQL functions?
If so, I am still having trouble executing this in that it is not identifying my sheet name. I have viewed the custom SQL to ensure that I have it right, but to no avail.
Any way to trouble shoot the problem? I'd be happy to send or post specifics if necessary or possible via the forum.
Thanks!
To add to this discussion, which I hope someone can respond to, I have attached a brief explanation of what I am trying to do. Keep in mind my data source right now is an excel file, where I have created and extract for the purpose of using RAWSQL statements. However, my interpretation of what RAWSQL can do could be entirely wrong for this purpose:
I want to slice and dice (filters, etc.) my view with a aggregated numerator, while holding onto a constant denominator.
Help!
Thanks to any and all
Steven,
You can accomplish the view you want in Tableau v4.0 using the new feature involving the filtering of Tableau Calculations. I am attaching a workbook were I created a calculated field "max(1)" and used it to create a running total Table Calculation for the categorical field that you wanted to filter, which assigns a unique number to each member. Since Table Calculation filtering happens after the percent calculation, you get the view that you want.
Jock,
Thank you! This does get me the results I was looking for in this case. Thanks again for your response!