Forum Discussion

TheKiltedGolfer's avatar
TheKiltedGolfer
Helper III
7 years ago
Solved

Creating a fill in table for gaps

I am trying to create a table, with continuous calendar dates, showing the total number of tickets opened per day per associate.  Sometimes a specific associate will not open a ticket for or day or even several days. I have the raw data for each ticket opened by an associate per day but I do not know how to create a table, based on the raw table, that fills in the gaps (puts a 0 as the count for that day for that associate) when an associate does not open a ticket.  Below is a simple version of my raw table called “INC Tickets.”  Any suggestions?  Associates can come/go on the team so would prefer not to try to hard code names into this, if possible.

 

Ticket#Opened DateOpened By
10009/1/2018Ann
10019/1/2018Ann
10029/3/2018Brian
10039/4/2018Dan
10049/4/2018Brian
10059/4/2018Dan
10069/4/2018Dan
10079/15/2018Cathy
10089/15/2018Cathy
10099/20/2018Cathy
  • TheKiltedGolfer -

     

    With a proper date calendar table 'dCalendar' you could take 'dCalendar' [Date] into a table visual and choose Show items with no data like the below image.

     

    Maybe a simple measure like 

    # Open Tickets = 
    IF(
        ISEMPTY('INC Tickets'),
        0,
        COUNTROWS('INC Tickets')
    )

    will yield :

    but this seems rather difficult to read and if I actually had a full calendar the scroll would last forever.

     

    Putting into a Matrix visual may be a better option?:

     

     

     

4 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    TheKiltedGolfer -

     

    With a proper date calendar table 'dCalendar' you could take 'dCalendar' [Date] into a table visual and choose Show items with no data like the below image.

     

    Maybe a simple measure like 

    # Open Tickets = 
    IF(
        ISEMPTY('INC Tickets'),
        0,
        COUNTROWS('INC Tickets')
    )

    will yield :

    but this seems rather difficult to read and if I actually had a full calendar the scroll would last forever.

     

    Putting into a Matrix visual may be a better option?:

     

     

     

    • TheKiltedGolfer's avatar
      TheKiltedGolfer
      Helper III

      Hello ChrisMendoza,

       

      I am very sorry for the late response but I want to thank you very much for your response.  It seems to work but I guess I do not understand how your simple measure actually works.  How does it know to key off of "Opened By," especially if I had more columns that it should not key off of, to fill in the gaps?

       

      Thanks Again

      • ChrisMendoza's avatar
        ChrisMendoza
        Resident Rockstar

        TheKiltedGolfer -

         

        By using the relationship between your 'INC Tickets' table and the 'Calendar' table I am able to ask the question "Is there a transaction that occured on this 'Calendar'[Date]?" If there is not, then the value is zero. Otherwise count the number of rows that occur on this 'Calendar'[Date].

         

        At this point, we're just counting rows, regardless of names (your request to not hard code these values) where transactions are occurring. Since you actually want to see who had transactions you put the filter context [Opened By] into the visual.

         

        Since you didn't have a desired output, I created the easiest to show what you were asking for.

         

        Hope that helps in your understanding.