Querying Tableau views with filters and parameters using the REST API

  Рет қаралды 5,906

Devyx

Devyx

Күн бұрын

Пікірлер: 21
@alyshai
@alyshai 7 ай бұрын
Dude - you just saved countless hours. I had been stuck on accessing a URL via the Tableau server and the server client. I had tried so many versions of the code but nothing had worked since Thursday. A minute into this video and you just solved the entire issue. Thank you for this video.
@saloniverma9663
@saloniverma9663 Жыл бұрын
This is by far the most helpful resource I've found to download visuals using python as clean datasets. Can you also please make a video where we can apply multiple filters and parameters with several values in them for a sheet?
@LeoStringaro
@LeoStringaro 2 жыл бұрын
Thank you very much, you saved my day!!!!!!!
@chuckdutchess
@chuckdutchess 10 ай бұрын
This has been such an amazing resource, thank you! Do you have any advice on how to specify whether an applied filter is a context filter or not? It seems by default the code assumes it is *not* a context filter.
@michaelmcguire3039
@michaelmcguire3039 2 жыл бұрын
This is a great video (have checked out a few of yours on similar topics). I was wondering if you had ever had any issues with this method displaying cached views if/when you have refreshed the data? Keep up the great videos!
@devyx
@devyx 2 жыл бұрын
Thanks, Michael! Yes, cached versions of what you query can be an issue and there are two ways around this: one is to specify a URL parameter that ignores the cache, and an older approach (for Tableau Server before that URL parameter was introduced) is to add a dummy parameter to your workbook/view and then pass it a different value with each query to trick Tableau into thinking it needs to re-query the data. I'm up in the mountains right now and don't have the links available, but you can find the exact details in the "Query View" endpoint documented on the Tableau REST API reference.
@michaelmcguire3039
@michaelmcguire3039 2 жыл бұрын
@@devyx Awesome thanks for the advice. Keep up the great content I know myself and others appreciate it!
@brot_ai3376
@brot_ai3376 3 жыл бұрын
How to deal with apply button while using filter? and Thanks @Devyx for this video.
@devyx
@devyx 3 жыл бұрын
Hey Nikhil, the apply button is not a factor when specifying filter values via REST API calls. If you specify a filter value, the REST API will behave as if that filter is applied. Worth mentioning that this is not changing or interacting with a dashboard like you might see in the JavaScript API, this is simply querying data from a view or dashboard that exists on the aerver.
@jaepark1593
@jaepark1593 2 жыл бұрын
How would you pass a field like the third param, "Another Param" text field as a parameter via API?
@dowiczm
@dowiczm 2 жыл бұрын
Awesome video! This really helped me with what I'm currently working on. I'm wondering if you have any insights on how to filter a Date Box (I think Tableau calls them "Relative Date Filters"). The view I'm requesting has one and the value seen in Tableau is something like "Last 7 days" or "Last 2 quarters". I think my answer lies in the .twb file you showed. How do I download that .twb file? Thanks in advance! Your videos are super helpful!
@devyx
@devyx 2 жыл бұрын
Hey Mark, glad it's helping! I'm not 100% about relative date filters, but you can download your workbook file and inspect how those specific dates are treated. For example, not long ago I was trying to pass in specific dates for a parameter that exists on one of my views/dashboards when querying via REST API. It was having no effect, and so I downloaded the Tableau workbook to see if the format of the date as it exists in the workbook internals matched what I was trying to specify. What I found is that the workbook's internals referenced the date in this format: yyyy-mm-dd (or 2022-01-21), even though in the parameter it appeared as 2022/1/21. The relative dates could be trickier, but in the worse case scenario if filtering dates via REST API is absolutely crucial for you, you could add two parameters to your workbook that impact your view/dashboard (they don't even need to be visible to the end-user, they'd just need to be impacting the relevant sheets behind the scenes by interacting with a calculated field that sits in the sheet's filters) and then you can specify the start date and end date through those parameters when querying via REST API.
@dowiczm
@dowiczm 2 жыл бұрын
@@devyx Awesome I'll give that a try. Appreciate the quick response!
@wereed
@wereed 2 жыл бұрын
@Devyx Great tip on using urllib to reformat text with special characters. I did this, but it still doesn't apply the filter correctly if the filter value has multiple words and special characters (commas, spaces). Is there anything else that might be causing this issue? When I have a filter value with one word, it works just fine.
@devyx
@devyx 2 жыл бұрын
Hey Walt, my advice here is to double and triple check that both your filter names and filter values are transformed into a URL-friendly format. If the filter isn't working it's either because the field itself can't be resolved (issue with the filter name) or the values can't be resolved (issue with the filter values). Might be worth checking if you have any aliases on your fields... my bet would be that you need to reference the true underlying values in terms of both your field names and your field values.
@wereed
@wereed 2 жыл бұрын
@@devyx Thanks for the help! I figured it out. When you have a special character, like a comma, you need to use the escape "\" (%5C) before that character. So if you had 'Chicago, Illinois' as a filter value, it would need be encoded as 'Chicago%5C%2C%20Illinois'
@devyx
@devyx 2 жыл бұрын
@@wereed Nice! Thanks for following up with what got it working, that might come in handy down the road 👍
@carlosvaldivieso5307
@carlosvaldivieso5307 2 жыл бұрын
For some reason I keep getting the default view even when applying filters to the view download. Any way you could help me? Even willing to pay for help.
@smileylav
@smileylav 10 ай бұрын
How can I use with sso login
@MichaelWeber-q4d
@MichaelWeber-q4d 11 ай бұрын
Tried the above code and was still unable to manipulate my start date parameter. If a parameter is dynamic and based on a date formula will attempting to just change the date have an effect on the parameter? Also when looking into my twb file my parameter code looks different would appreciate any help as this is driving me crazy
@niravdedhia878
@niravdedhia878 7 ай бұрын
I am doing the same and it is not working. I tried to find some articles but have failed
How to create a dynamic table in Tableau
16:27
The Analyst's Playbook
Рет қаралды 10 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 87 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 18 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 41 МЛН
Elasticsearch Deep Dive w/ a Ex-Meta Senior Manager
44:03
Hello Interview - SWE Interview Preparation
Рет қаралды 27 М.
tableau-api-lib (detailed): getting started
13:20
Devyx
Рет қаралды 14 М.
You're Probably Wrong About Rainbows
27:11
Veritasium
Рет қаралды 3,6 МЛН
Introduction to Dash Plotly - Data Visualization in Python
29:21
Charming Data
Рет қаралды 803 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 87 МЛН