5 Replies Latest reply on Sep 21, 2018 11:30 AM by tadd.wagner

    How to avoid "skipping" null rows in table calculation?

    cyu cc

      Hi ALL, it seems I have a question with the table calculation in tableau. The situation is described below:

      Source data:                                                                     

      DayModelQty
      1A1
      1B1
      1C1
      2B3
      3A1
      3B1
      3C1
      4C3
      5A1
      5B1
      5C1

      Suppose we were producing three kinds of products: A, B & C. The data table shows the amount of each product every day. (Note: If some model is not produced some day, then the record is missing. E.g.: Day 2 has no records of model A/C, Day 4 has no records of A/B)

      Now I want to draw a chart, showing the qty of each model and the total qty. The result should be like this:

      But what I really got is this:

      The total qty in some blocks is wrong. It seems during calculating the total qty with RUNNING_SUM (or WINDOW_SUM is the same), the NULL rows are skipped. For example, Model A(the blue block), in Day 1, the total qty is 3; In Day 2, the total qty should be 6, but the sum-up is skipped because no Model A is produced in Day 2; The same thing happens in Day 4.

       

      Can anyone tell me how to make the table calculation DO NOT skip the NULL rows unless insert the missing records(mentioned above) to the source data?