3 Replies Latest reply on Oct 19, 2017 5:08 AM by Prakhar shrivastava

    An error occurred while communicating with the data source tableau

    Prakhar shrivastava

      I found connection loss while refreshing the extract data from tableau. I used tableau 10.3 version.

      I used this query. This query give me result in 6min on mysql workbench perhaps when i used same query in tableau its said connection loss after 200 min.

       

       

        SELECT

        o.order_id as order_id,

        DATE(o.booking_date) as bookingdate,

        CONCAT('Week - ' , WEEKOFYEAR(o.booking_date)) as bkngwk,

        o.hotel_id as hotel_id,

       

        CASE WHEN o.voucher_type = 'refund' THEN (o.user_amount - o.reduced_value)

        WHEN o.token_value = 'Bereits bezahlt' THEN  (o.user_amount - o.reduced_value)

         ELSE o.user_amount END as revenue,

       

        CASE WHEN o.acq_partner IS NULL THEN g.goo_source ELSE o.acq_partner END as channel,

        CASE WHEN ac.category IS NULL THEN a.category ELSE ac.category END as category,

        CASE WHEN ac.perc_share IS NULL THEN a.perc_share ELSE ac.perc_share END as perc_share,

       

        g.goo_medium

       

        FROM orders o

        LEFT JOIN google g ON g.goo_id = o.order_id

        LEFT JOIN acquisition_channel_cost ac ON o.acq_partner LIKE ac.channel_name

        LEFT JOIN acquisition_channel_cost a ON g.goo_source LIKE a.channel_name AND o.acq_partner IS NULL

        where o.order_status = 5

        AND YEAR(o.booking_date) = YEAR(now())

        AND DATE(o.booking_date) < curdate()

        GROUP BY order_id