4 Replies Latest reply: Dec 13, 2017 2:11 AM by Evgeniy Sharahov RSS

    Difference in two simple ways of data loading (from qvd and excel)

    Evgeniy Sharahov

      Hello!

       

      Problem:

      I've got an excel file that I stored into QVD and I load some fields from there in the script attached below.

      There are two ways of data loading with the difference only in 2 and 5 rows: loading from the qvd and from the excel.

      The problem is I get different results.

      When I try to count of "Ins" and "Outs" the first way give that count of "In" = count of "Out" (It doesn't correct), but the second one give a difference. How can I get the difference in calculation of count using loading from qvd?  What's the difference in these ways?!

       

      First way:

      1. DataTemp:
      2. Load 'In' as DataType, Field_1, Field_2, etc... from Data.QVD;
      3. Concatenate(DataTemp)
      4. Load 'Out' as DataType, Field_1, Field_2, etc... from Data.QVD;

      5. NoConcatenate
      6. DataTemp2:
      7. Load
      8. DataType, Field_1, Min (Field_2) as In
      9. Resident DataTemp where DataType='In' Group by ...

      10. Concatenate(DataTemp2)
      11. Load
      12. DataType, Field_1, Max (Field_2) as Out
      13. Resident DataTemp where DataType='Out'  Group by ...
      14. Drop table DataTemp;

       

      Second way:

      1. DataTemp:
      2. Load 'In' as DataType, Field_1, Field_2, etc... from Data.xlsx;
      3. Concatenate(DataTemp)
      4. Load 'Out' as DataType, Field_1, Field_2, etc... from Data.xlsx;
      5. NoConcatenate
      6. DataTemp2:
      7. Load

      ... (the same script)

       

      Best wishes,

      Evgeniy