Skip to main content

Hi Tableau fellas,wondering if this is achievable in Tableau and very much appreciate your advise or any alternative would be helpful.

 

I have 2 tables within a database. For illustration purpose I put them together in an excel, so that it is easier to understand.

 

1 table contain the calls column as well as the Avg talk time column. The other table contain the No of trunks and its associate Erlang value. What I what to achieve is the result in cell C3. The logic is describe in cell C2.

 

Much appreciate your help in advance.

 

Referencing Database Table in Tableau

6 answers
  1. Aug 2, 2015, 11:07 AM

    Hi Raymond,

     

    This is certainly possible in any number of ways:

     

    Depending on how your data is structured and whether a common key is available in both you could easily join the tables together in the data model 'connect to data' page which may offer the cleanest method as the join is row-based.

     

    If no key field is available, then you can either write custom sql and define the key on the fly or create some form of db view.

     

    The third alternative which is often the most prescribed choice is that of a data-blend - be warned as the secondary data-set is pre-aggregated on joining so any primary measures used must also be aggregated  unless the attr() function can be used on the secondary source to identify unique values (if they are needed).

     

    Am I right in thinking that the output of the calc defines the key for the trunking table?  If so, I would recommend you create a view to maintain the join then just connecting to the view:

     

    Select

    a.*

    ,b.*

    From (

        Select

        a.Column1

        ,a.Column2

        -- etc

        ,(Sum(a.Calls) / Sum(a.Avg_Time))*1800 As Table_B_Key

        From Calls a

        Group By

        a.Column1

        ,a.Column2

        --etc

    ) a

    Join Trunk b On a.Table_B_Key = b.No_Of_Trunk

     

    Steve

0/9000