14 Replies Latest reply: Jan 10, 2013 12:52 PM by Filippo Tabusso RSS

    wrong key field count

      Hi,

       

      I have found that a chart result (field count) dipends on script load order. Here is the simple case I built to isolate the problem. The script is:

       

      table_ab:
      load * Inline [
      A, B
      10, 20
      12, 22
      12, 23
      17, 23
      18, 26
      19, 26
      ];
      
      
      table_bc:
      load * Inline [
      B, C
      20, 31
      20, 32
      25, 33
      25, 34
      26, 35
      26, 36
      ];
      
      

       

      As you can see there are two tables connected by field B.

       

      If I try to count B using B as dimension I get:

       

      B Count(B)
      20 1
      22 1
      23 2
      25 1
      26 2

       

      The first strange thing is that values 20 anf 25 are counted once even if, in table_bc, they appear twice. I'm not sure about value 26, maybe count should be 4?

       

      The second strange thing is that if I invert table load order (table_bc loaded before table_ab) the count of B changes:

       

      B Count(B)
      20 2
      22 1
      23 1
      25 2
      26 2

       

      Now it seems that the count is "made primary" on table_bc (the first one read) since valie 20 has count equal to 1 and value 23 has count equal to 2.

       

      So we have two (connected) strange things:

      1) count of key field seems to have a "primary" table,

      2) final result depends on table load ordere

       

      Can anybody explain me this behaviour?

       

      Thanks in advance to all replies.

       

      Filippo