Can anyone provide a link on how to set-up tabpy to tableau web server/ online. I am able to connect tabpy to Tableau Desktop. But if I want others to also access tabpy functionalities, i need Tableau Web server to talk to tabpy
How to return single string value in calculated field using Tableau data from python and present it on new sheet of Tableau as Text value. For example, Data contains lists of cities and population of city. These are represented in graph in Tableau. We would like to find city having maximum population. Python code is written using max function. The python code is returning correct value to tableau, however there are multiple rows returned to tableau while I need only single value. Incase we are using label for returning maximum population in Tableau, it doesn’t return any value if we are not passing parameters in row and column field which are used in python code. Below python code is used to find maximum population in city: SCRIPT_STR(" city_list = _arg2 population_list = _arg1 highest_population = max(population_list) ind = population_list.index(highest_population) city_name = city_list [ind] output_str = ' '+str(city_name)+' with highest population: '+str(highest_population) return output_str ", ATTR([City]),SUM([Population]))
Hi CK, there's a field and a parameter called "Selected country". The parameter can easily be created by clicking on the dropdown-arrow in your data pane and select "Create Parameter". Set the data type to be a string and allow "all values". The field is a calculated field, the formula of which is shown at 31:30.
Was working, but recently I tried to do it again and I receive it an error An error occurred while communicating with the Analytics Extension. Error processing script KeyError : 0
@@MarcelKol27 Lost half a day till I saw your comment. Is this some new rule? This should be also present if I am doing some other APIs (_arg1 should have [0]) or this is just for this particular case? Why did it change than it was before like in this video presentation? Thank you.
Hello Gaurav, this is the World Indicators dataset which is included with Tableau Desktop by default. You can access it by looking in the 'Saved Data Sources' section of the Connect pane when you load Tableau.
There's a field and a parameter called "Selected country". The parameter can easily be created by clicking on the dropdown-arrow in your data pane and select "Create Parameter". Set the data type to be a string and allow "all values". The field is a calculated field, the formula of which is shown at 31:30.