Skip to content

Instantly share code, notes, and snippets.

import sys
import tableauserverclient as tsc
TABLEAU_CREDENTIALS = {
"server_url": "",
"username": "",
"password": "",
"site": ""
}
@jfreels
jfreels / l7d.py
Created November 30, 2021 00:10
Determine product usage over the last 7 days
""" Determine product usage over the last 7 days """
import sys
DATALIST = {
"android": [0,1,1,0,1,1,1],
"iphone": [0,1,1,0,1,1,0],
"web": [0,0,0,1,1,1,1]
}
@jfreels
jfreels / average_duration_stream.py
Created November 30, 2021 00:11
Determine average duration for each step across all sessions
""" Determine average duration for each step across all sessions """
import sys
STREAM = [
# session, step, timestamp
[1001, 1, 100000010], # duration = 11
[1001, 2, 100000021], # duration = 12
[1001, 3, 100000033], # duration = 13
[1001, 4, 100000046], # duration = None (there's no next step)
[1002, 1, 100000010], # duration = 10