This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
hvc.customer_id | |
, total_revenue | |
, days_since_first_seen | |
FROM ( | |
SELECT | |
customer_id | |
, SUM(total_revenue) AS total_revenue | |
FROM transaction_details td | |
LEFT JOIN customer_details cd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH high_value_customers AS ( | |
SELECT | |
customer_id | |
, SUM(total_revenue) AS total_revenue | |
FROM transaction_details td | |
LEFT JOIN customer_details cd | |
ON td.card_id = cd.card_id | |
GROUP BY 1 | |
ORDER BY 2 DESC | |
HAVING total_revenue > 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas.io.json import json_normalize | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils import flatten_dict_column, flatten_dict_list_column | |
# using personal access tokens is preferred; otherwise, comment those details out and use username / password | |
tableau_server_config = { | |
'my_env': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas.io.json import json_normalize | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils import flatten_dict_column, flatten_dict_list_column | |
from tableau_api_lib.utils.querying import get_sites_dataframe | |
# using personal access tokens is preferred; otherwise, comment those details out and use username / password | |
tableau_server_config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas.io.json import json_normalize | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils import flatten_dict_column, flatten_dict_list_column | |
from tableau_api_lib.utils.querying import get_sites_dataframe | |
# using personal access tokens is preferred; otherwise, comment those details out and use username / password | |
tableau_server_config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils import querying, flatten_dict_column | |
# using personal access tokens is preferred; otherwise, comment those details out and use username / password | |
tableau_server_config = { | |
'my_env': { | |
'server': 'https://10ax.online.tableau.com', # replace with your own server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.sample import sample_config | |
from tableau_api_lib.utils import querying | |
from tableau_api_lib.utils.common import flatten_dict_column | |
# sample config | |
tableau_server_config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_workbooks_dataframe, get_datasources_dataframe | |
TS_CONFIG = { | |
'my_env': { | |
'server': 'https://YourTableauServer.com', | |
'api_version': '<YOUR_API_VERSION>', | |
'username': '<YOUR_USERNAME>', | |
'password': '<YOUR_PASSWORD>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableauhyperapi import HyperProcess, Connection, TableDefinition, SqlType, Telemetry, Inserter, CreateMode, TableName | |
from tableauhyperapi import escape_string_literal | |
PATH_TO_CSV = 'sample_csv_for_hyper.csv' | |
PATH_TO_HYPER = 'test_hyper_extract_api.hyper' | |
# Step 1: Start a new private local Hyper instance | |
with HyperProcess(Telemetry.SEND_USAGE_DATA_TO_TABLEAU, 'myapp' ) as hyper: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_projects_dataframe | |
# Set the following constants according to your environment | |
YOUR_PROJECT_ID = 'ENTER_YOUR_TS_PROJECT_ID' | |
YOUR_WORKBOOK_FILE_PATH = 'ENTER_YOUR_WORKBOOK_FILE_PATH' | |
YOUR_WORKBOOK_NAME = 'ENTER_YOUR_DESIRED_WORKBOOK_NAME' | |
YOUR_TABLEAU_SERVER_ADDRESS = 'ENTER_YOUR_TABLEAU_SERVER_ADDRESS' | |
YOUR_DB_SERVER_ADDRESS = 'ENTER_YOUR_DB_SERVER_ADDRESS' |
NewerOlder