Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From simple to more advanced: Lessons learned i...

From simple to more advanced: Lessons learned in 13 months with Tableau

In the talk described our experience of integration Tableau into our data reporting and Business Intelligence process.
Switching from in-house reporting solution to Tableau reporting, data refreshes with Command Line Utility
and other small tips and tricks. Using Tableau reports for building a flexible system for monitoring KPI of a company.

Sergii Khomenko

November 03, 2014
Tweet

More Decks by Sergii Khomenko

Other Decks in Programming

Transcript

  1. S T Y L I G H T . C

    O M From simple to more advanced: Lessons learned in 13 months with Tableau S E R G I I K H O M E N K O , D A T A S C I E N T I S T , S E R G I I . K H O M E N K O @ S T Y L I G H T . C O M , @ l c 0 d 3 r
  2. L i f e b e f o r e

    T a b l e a u C u r r e n t S t a t e o f A r t A d v a n c e d t e c h n i q u e s A G E N D A
  3. The life before Tableau D I F F E R

    E N T T O O L S , D I F F E R E N T A P P R O A C H E S
  4. D a t a c o n s i s

    t e n c y N o t f l e x i b l e s t r u c t u r e – r e p o r t c h a n g e D i f f i c u l t t o s c a l e T i m e - c o n s u m i n g – f o r n e w a d - h o c M a i n t a i n a n d s u p p o r t – i n - h o u s e d e v e l o p m e n t I n s h o r t t e r m M o r e f l e x i b l e E a s y t o a d d a l e r t i n g P R O B L E M S :
  5. Current state of art T H I N G S

    W E A R E H A P P Y A B O U T
  6. T a b l e a u i s n

    o t y o u r d a t a w a r e h o u s e C o n n e c t i n g G o o g l e A n a l y t i c s C u s t o m e x t r a c t t r a n s f o r m l o a d P R O B L E M S :
  7. Advanced techniques H O W T O M A K

    E T A B L E A U E V E N M O R E U S E F U L
  8. TABLEAU_PATH = 'c:\\Program Files\\Tableau\\Tableau 8.2\\bin'! DATA_SCTRUCT = [('date', tde.Type.DATE),! ('timeframe',

    tde.Type.INTEGER),! ('rank_id', tde.Type.INTEGER),! ('rank_name', tde.Type.UNICODE_STRING),! ('rank_class', tde.Type.UNICODE_STRING),! ('shop_id', tde.Type.INTEGER),! ('shop_rank', tde.Type.INTEGER),! ('active-traffic', tde.Type.UNICODE_STRING),! ('active-server', tde.Type.UNICODE_STRING)]! ! Tableau Data Extract API S c h e m a d e f i n i t i o n
  9. def push_source(source, filename): """ Push data source to Tableau Server

    """ template = open('cmdpush.txt', 'r').read() config = template % (filename, source) params = config.split("\n”) formatted = list(itertools.chain.from_iterable([make_argument(param) for param in params])) formatted.insert(0, "tableau.com") formatted.insert(1, "addfiletoextract") current_path = os.getcwd() os.chdir(TABLEAU_PATH) output = check_output(formatted) os.chdir(current_path) return output Tableau Data Extract API P u s h d a t a s o u r c e
  10. for source in sources: config = template % source params

    = config.split("\n") def make_argument(param): name, value = param.split("=") return ("--%s" % name, value) formatted = list(itertools.chain.from_iterable(map(make_argument, params))) formatted.insert(0, "tableau.com") formatted.insert(1, "refreshextract") try: os.chdir(tableau_path) output = check_output(formatted) if output: logger.exception('Exception during the execution: %s' % output) Tableau Data Extract Command-Line Utility M a n u a l r e f r e s h e s
  11. parser = argparse.ArgumentParser(description='GoogleAnalytics to Tableau ETL script') parser.add_argument('--date', '-d', metavar='date',

    default=(date.today() - timedelta(1)).isoformat(), help='A date used to ETL data') args = parser.parse_args() source = 'GA data' table_def, tdefile, tabletran = tableau.init_source(source) generate_ga_data(table_def, tabletran, args.date) tdefile.close() tableau.push_source(source, "%s\\%s.tde" % (os.path.dirname(os.path.realpath(__file__)), source)) Custom Google Analytics to Tableau M a n u a l r e f r e s h e s
  12. S T Y L I G H T . C

    O M Sergii Khomenko Data Scientist STYLIGHT GmbH [email protected] @lc0d3r Nymphenburger Straße 86 80636 Munich, Germany