UNION ALL Not Preserving Duplicate Rows in Exports and Reports

Dear Team,

I hope this message finds you well.

I’m encountering an issue with the UNION ALL operation in MySQL. Specifically, it behaves like a regular UNION by removing duplicate rows instead of preserving them. Here’s what I’ve observed:

  1. When I attempt to UNION ALL two empty rows, the result only shows a single row.
  2. Similarly, if I try to add two rows with the same values, the second row gets removed.

According to MySQL behavior, UNION ALL should retain duplicate rows, so we must be able to create duplicate rows using it.

Key Observations:

  • In Holistics Model View: The query works correctly, and the duplicates are preserved.
  • In Exports or Reports Tab: Duplicates are removed, even when exporting to Excel.
    Attached are images for clarity on the issue.

Could you please investigate why UNION ALL behaves differently in these cases? Most importantly, ensuring that duplicates are preserved when exporting data or viewing it in the Reports Tab would be critical for accuracy.

Thank you for your attention to this matter.

Best regards,
Hamza

Hi Hamza,

Holistsics Datasets automatically de-duplicate the rows in the explores/reports (built from Datasets), as mentioned here.

Thus, in order to list the actual rows of your database, please include a unique column (e.g. ID) in your report. Alternatively, you could include a COUNT column in your report to denote the number of duplicates of a row.

Besides, you can export data using the SQL Editor, which does not de-duplicate rows unless you make a visualization.

In case you cannot make it work for your use case, please let us know and we will see how we can support your case better.

Thank you for your quick response … I will try and will let you know the outcomes

2 Likes