2 Replies Latest reply: Oct 18, 2018 2:12 PM by Petter Skjolden RSS

    The table total is not the sum of individual rows

    Julia Muravchik

      Hi Qlik Community!

      I am hoping you could help me with a question... I have been doing a lot of research online, but wasn't able to find the answer to the question  -

      I use Qlik Sense. I simply created a straight table. The total is not equal to the sum of individual rows. I am wondering why?

      To give you a little background here -

      I have an ODBC connection set up to Misrosoft SQL DB. There are 2 tables where I am pulling the information from: revenue and discounts. This is one-to-many relationship. One order may have 2 discounts.

       

      For example, we have 1 order completed (Order1) for the total of $10 and 2 discounts (one is $5 and another one is $3). The below is how Qlik Sense records it in the table. Instead of summing $10 and $10, Qlik Sense recognizes somehow that it is one $10-dollar order and records $10 as the total.

       

      How does Qlik Sense know not to add the rows up and recognizes what the right calculation is?



                          Revenue        Discount_Type         Discount_Amount

      Order1        10                   A                              5

      Order1        10                   B                              3

      Total       10                                           8

       

      Thank you for your help in advance!

      Julia