I'm just guessing, but have you tried an empty value or a zero to see if you get the results you expect? I'm curious what the use case is for calling a NULL value from a parameter?
Yes, I tried zero but that does not give the data I expect. Zero is a legitimate value and so it would not give the same results as a NULL.
NULL is used in database language to indicate an invalid value. Any data type could be NULL, e.g. numbers, strings, or dates. Stored procedures can accept null values as parameters when that parameter is not needed or if a default value is to be assigned. There are many cases in which a stored procedure would accept a null parameter.
I wasn't doubting that it was a legitimate value and I understand what NULL means; I was just curious about an actual business use case for when this would be needed or useful.
I assume you tried leaving it blank? The reason I replied in this thread is that I connect to stored procedures, and we leave out the parameters and basically use the connection like a view (for a number of reasons).
Can you just assign an integer for the invalid values as a workaround?
Thanks, and good luck. I'd certainly suggest contacting email@example.com with this one if you haven't already.
Sorry, I'm probably misunderstanding your question/response. I used Tableau 7 a lot but I'm new to version 8.
My stored procedure has a parameter indicating an ID. Specifying the ID returns only data that matches the ID. Passing NULL would return all data, regardless of ID. The business case would be to get all data in the data source so that I can use filters,etc in Tableau rather than changing the data source when changing ID.
How do you leave the parameter blank? Can you delete the parameter when you create the data source?
My use case is very different as you have multiple parameters. In my case, we omit the need for a parameter of any kind and use sprocs almost like a db view when we connect, if that makes sense at all.
Did you contact support?
were you able to get this figured out? I'm having a similar issue. I have sp that can have nulls passed in, but Tableau doesn't like it and errors out. I can run the same sp in SQL Server and leave the values null and it runs.
Guessing this still isn't possible? Searched everywhere found no answers.
1 of 1 people found this helpful
After trying a million things the way I got it to work in 10.3 was to 'Create new parameter', it defaulted to the correct data type, I deleted the 'Null' string that appeared and just left it blank. I used that tableau parameter for each of my SQL parameters that needed to be NULL. Worked for me.
thanks. i will try this next time i have a string parameter.
Now I have a date parameter for which i want to pass null as a value. Tableau doesn't seem to let me set a date parameter to null.
funny after all these years (>4 years since my original post) this is still an issue for me. I googled for an answer and got my own unanswered question!
Looks like I will create a new stored procedure that doesn't take in a date parameter. Most of our other procedures take no parameters so we don't have this problem, but i had hoped this issue with Tableau had been fixed.