Author: Mayank Tiwari
Introduction
As we know that Jupytab is used when we want to display results according to our Python scripts running behind the scenes, basically for the ML part. Now we will see how to use it when we want to have parameters that actually change from the dashboard side of Tableau, and all calculations happen on the notebook side, and we see the change in the dashboard without affecting the actual data.
Prerequisites
For this, you need to have a connection between Tableau and Notebook
Dynamic part
After doing the steps mentioned in How To Connect A Jupyter Notebook To Tableau Using Jupytab? , you can move ahead with the below part.
1) Analytics Extension Connection
i) When you have a server up and running, you need to go to Tableau and see for Manage Analytics Extension connection in Help ->Settings and Performance, and there you will see a lot of options

ii) Choose Analytics Extensions API.

See for link generated through Jupytab server
iii) Here the hostname is DESKTOP-RVE247D and port is 8123 as you specified in config file

iv) Click on Test Connection you will see a success dialog opens up, which means the connection is successful.

2) Write Python Functions on the Notebook side
Then you have to write Python functions from your notebook side

Here we are accepting parameters from Tableau, then we can return the results after doing all processes, and our dashboard will alter accordingly; we are simply attempting to use jupytab methods here.

3) Create calculated fields on Tableau side
For Tableau we have to create calculated fields that will have a parameter Weight which we need to create to have input from Tableau side.

After this, you will see the dashboard changing on entering different values on the tableau side.
Conclusion
Thus far, we've covered dynamic interaction with Tableau and Jupytab; the use case will undoubtedly be more beneficial when a complex ML model is running behind the scenes, and we can witness the changes in real-time. I merely wanted to show how it's done because I find it fascinating.