Forum Discussion

PhillipB's avatar
PhillipB
Frequent Visitor
3 years ago

Average Line from another table

I am trying to create a Column and Line chart with information from 2 tables.  The first table has the date field and the main information with dates associated.  The second table has other information also with a date associated with in the same range.

 

When I then try to add a line from the second table and create an average it ignores the dates and simply provides an average of the entire date range shown on the chart.

 

If the tables are linked through a calendar table or directly with the dates then the average does not show at all.

 

Some pointers would be great.

 

 

5 Replies

    • PhillipB's avatar
      PhillipB
      Frequent Visitor

      Thanks lbendlin 

       

      I have looked at TREATAS() but I am not sure that this is giving me what I need.

       

      DateIncident
      1 jan 2022A
      3 jan 2022B
      8 jan 2022A
      19 jan 2022A
      2 feb 2022C
      4 feb 2022A
      8 feb 2022

      B

      10 feb 2022

      C

      14 feb 2022A

       

      DateQuantity
      2 jan 20223%
      7 jan 20226%
      9 jan 20225%
      18 jan 20226%
      4 feb 20225%
      9 feb 20224%
      11 feb 20226%
      13 feb 20227%
      14 feb 20223%

       

      These two table are an example

       

       

      And this is the kind of output but ideally I would like to show the line on the bar chart.  The line is an average of per month, the bars are a count per month.

       

      I can link the data but if I do that, either directly or via a calendar table (with days) neither works correctly.

       

      Regards
      Phillip

  • PhillipB's avatar
    PhillipB
    Frequent Visitor

    Yes your example works perfectly however for the data I am using it still is giving me some issues.  I have tried the method you have shown but it is not acting as it should.  I will send over the dashboard via a private message

    • lbendlin's avatar
      lbendlin
      Super User

      Both your date columns were in DateTime format including a time component. That prevented them from successfully linking to the calendar table.

       

      Sent you the file via DM.