Is it possible to set a default, initial, value for a parameter in Tableau? Moreover, is i possible to have this contingent on the value of another parameter or dimension?
So for instance, having two time-series A and B with the same measures/dimensions etc., I would like to scale a specific measure within these using the above mentioned parameter. The initial scaling value, however, is supposed to be different depending on time-series A or B.
Any thoughts here?
Thank you
Parameters support a default/initial value. It is called 'current value' in the 'Create Parameter' window.
Parameter values can be changed only using user interaction. It's value cannot be changed using another parameter or dimension, but you can restrict the allowed values based on a dimension.
Above restriction is generally not an issue as you can create calculated fields that depends on other parameters or dimensions. This should be applicable in your case as well, but impossible to be sure without a data set sample.
Related
Is there a functionality in Tabluau to create a variable that can be used in few places by referring to its name? I'm asking because I need to prepare a dashboard and the data loaded and displayed on the dashboard can contain two different variables in column called value. So I would need to define such a 'variable' that would be filled with the type of value column (ex. type 1 or type 2) and use it as a axis name, in a tooltip etc. Of course, I'm trying to avoid a necessity to change all the axis names and tooltips manually.
In Tableau, they are called parameters. Please refer to following articles to learn more about this.
Parameter basics
Swapping Measures using parameter
I believe what you are asking is covered in link 2.
In Tableau 9.2, I currently have a parameter set up which contains multiple string values and an additional "All" value. I also have a calculated field which only contains the Str([some_field]) function. I have then dragged this calculated field into the "filters" pane and from there enabled "use all" and put the following formula under the "condition" tab:
// If All is selected, then do not filter
[my_filter_parameter] = 'All' OR
// Otherwise, filter on the current parameter
[my_filter_parameter] = [my_calculated_Field]
After creating the calculated field for multiple sheets in my dashboard (which use different data sources all contain the common some_field), then I can change the parameter's value and it will filter all of the sheets at once.
My issue is that I need this to take on multiple values at once via a check-box. I understand that a parameter can only take on one value at a time, so I am wondering how I can do this without making the same filter for each individual sheet in the dashboard. Perhaps this can be done with a calculated field?
EDIT: I have tried the technique here to make a global filter via a control view. This allows me to use Ctrl+Clicking to select multiple values in some_field at once, however I still do not have a dropdown box. Alternatively, if anyone knows how to use this method with a dropdown box, then that would be another solution.
If I am understanding your situation correctly, I have accomplished this using the following:
Create a calculated field and put the following code:
if [parameters].parametername = 'All' then true
elseif [parameters].parametername = FILTEREDCOLUMN then true
else false
end
Add that calculated field to the filters pane and select "True" - in other words, filter out any records where the calculated field is False. If the parameter you selected is "All" then all records will be True. Otherwise, it will only be True if the parameter matches the FILTEREDCOLUMN. I hope that helps.
Parameter can pass only one value at a time ,i.e. Parameter Control will have Single Drop Down List.
I have a report which creates a list of Events for a specified date range and event type.
The date range and event type are parameters defined in the report. The date parameters (#DateFrom and #DateTo) work as they should.
The #EventType parameter however, which is defined as a list of values provided by a DataSet (with 'Allow Multiple values' checked), does not provide the expected behaviour when using the {Select All} check box. If I select one or more Event Types by checking several boxes on the list, the report will show the Events which match the specified Event Types correctly.
However, if I click the {Select All} box (which then highlights all of the other possible values), the report does not show the Events for all of these Event Type values. It seems to miss out several of the values which are selected by the {Select All} box. If I run the report specifically for those missing values, the report returns events matching those types. This indicates to me that there is not a lack of data for these types.
And for that reason, it looks to me like the {Select All} is bugged...or perhaps cached somewhere? I've tried deleting the report/parameter dataset and redeploying to no avail. It's worth noting that this behaviour happens locally before deploying it, too.
Has anyone seen this before, or does anyone have any suggestions?
EDIT - I should also mention that the parameter in question (#EventType) has no default value assigned.
How are you declaring your predicate for the variable? It should be be like:
where thing in (#Variable)
Where #Variable is a multi value parameter.
You could attempt to see if the values of the multi valued parameters are junked up somewhere as well by defining them. Generally the collection method of multi valued parameters can cause issues if there data types are different.
Also you may try to design your data set at runtime to build instead of being a static query. EG: Set up an expression for your dataset like:
="Select * from table where thing in (" & Parameters!Variable.Value & ")"
This would cause the parameter to build as part of a string and then evaluate at run time instead of from a traditional query.
Can't quite believe that this was the case, but the parameter which was passed to the SQL Server procedure was too small. It was defined as a VARCHAR(500) and needed to be bigger to deal with a large list of comma separated values. I changed it to VARCHAR(4000) and it's now functioning as expected.
Thanks to Djangojazz for pointing me to the direction of the parameter.
I'm trying to make a nullable integer, that is an integer which can also have a value set as null.
To do this, I was hoping to have an integer input with a check box to signify it is null (which could then have JavaScript hook up to disable/enable the integer input).
I see three ways of doing this:
Have a custom Type which has two fields.
Have a custom form widget which handles the two.
Some combination of one and two.
I'm not having any trouble with that, it's pretty straight forward.
What I can't seem to find any documentation about is how to get those two fields to funnel in to a single variable.
Any ideas?
The best way I can see is applying a form transformer to your form.
If the checkbox is checked you set null to your property, if it isn't you assign the value of your integer widget.
You can have a look here and apply this to your particular case.
Side note: I wouldn't do this in the controller, it's not his job.
In SSRS ,I'm trying to build a report using this Parameter screen. One of the parameters takes 5 values, shown below:
Src
However, it's not working.. and I'm not sure why. I also don't understand what's the difference between "Available values" and "default values" ? Any tips appreciated, thanks
Available values are those values that you allow that parameter to have. They are selectable from a drop down list. You can either specify them manually, as you have done, or populate the available values from a dataset.
Default Values holds the initial value that the parameter will be set to. This will be one of the available values. In your example you might set the default value to 0 to indicate a default of "No repsonse to survey". If all the parameters have default values then the report will run automatically.
Now you say it is not working but you don't define what not working means. Please edit your question to define what is happening and what you actually want to happen.
I'll take a quick guess that the values returned aren't being filtered by your parameter selection? If so, you have to use your parameter in the query or the Filter expression of your dataset.
For example, if your parameter is called Response then the dataset query should be something like
SELECT *
FROM Responses
WHERE ResponseValue = #Response