KNOWLEDGE BASE

Output Results Change Each Time the Flow Is Executed When Using ROW_NUMBER


Published: 22 Dec 2022
Last Modified Date: 29 Jan 2024

Issue

Output results change each time the flow is executed, or GUI and output results are different.

Environment

  • Tableau Prep Builder

Resolution

Option 1

Specify the combination of fields whose row values are unique in the PARTITION clause, if possible.


Option 2

Output data after a Clean step with the calculated field that uses ROW_NUMBER function, and connect subsequent steps to the output data. The ROW_NUMBER result becomes static by outputting the data.

Cause

The output results may be different if ROW_NUMBER function is used and tables are joined using that field. When specifying the combination of fields whose row values are not unique in PARTITION clause, ROW_NUMBER returns different results each time the flow is executed as described in the following website.

Supported analytic functions
ROW_NUMBER()
Assigns a sequential row ID to each unique row. No row number values are skipped. If you have duplicate rows and use this calculation, your results might change each time you run the flow if the order of rows changes.
Did this article resolve the issue?