<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Row Number Error in MV Spark SQL in Data &amp; Schema Discussions</title>
    <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6179#M540</link>
    <description>&lt;P&gt;How are you running this sql? Is it via MV or a postgres sqli connection?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 22:00:19 GMT</pubDate>
    <dc:creator>amit_kothari</dc:creator>
    <dc:date>2024-12-09T22:00:19Z</dc:date>
    <item>
      <title>Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6160#M532</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I’m trying to generate a Row Number using the query below, but it seems that Incorta is not returning the correct results. I checked the same query in another SQL editor, and the results were correct there. It seems either I'm missing something or there might be a bug in Incorta.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the Sample file below, Appreciate if you can help me with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL Query :&amp;nbsp;&lt;STRONG&gt;Select *, row_number() over( partition by company, Supplier_code_JOIN, Item_code, Warehouse_code order by ( case when Outstanding_Quantity = ExcessPOSTPONE then 1 when Outstanding_Quantity &amp;lt; ExcessPOSTPONE then 2 else 3 end, Outstanding_Quantity desc, cast(order_date as date) desc ) ) as RowNum from Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nikhil_cr_0-1733132385014.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/2737i925F5135C7FA1A44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nikhil_cr_0-1733132385014.png" alt="nikhil_cr_0-1733132385014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 09:49:10 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6160#M532</guid>
      <dc:creator>nikhil_cr</dc:creator>
      <dc:date>2024-12-02T09:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6175#M536</link>
      <description>&lt;P&gt;Is it possible you have the incorrect data type for orderdate? Perhaps it's ordering orderdate as a string descending when you expect it to be ordering based on a date datatype?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 19:05:31 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6175#M536</guid>
      <dc:creator>JoeM</dc:creator>
      <dc:date>2024-12-04T19:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6176#M537</link>
      <description>&lt;P&gt;I thought the same initially, so i casted the orderdate to date and doubled checked the data type in the table but still i did not get the desired results.&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 07:48:42 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6176#M537</guid>
      <dc:creator>nikhil_cr</dc:creator>
      <dc:date>2024-12-05T07:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6177#M538</link>
      <description>&lt;P&gt;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/523"&gt;@nikhil_cr&lt;/a&gt;&amp;nbsp;- That was the only possibility I could think could be the case. It might be worth opening a ticket with support since it might require a dive into the engine.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Joe&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 19:28:29 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6177#M538</guid>
      <dc:creator>JoeM</dc:creator>
      <dc:date>2024-12-06T19:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6179#M540</link>
      <description>&lt;P&gt;How are you running this sql? Is it via MV or a postgres sqli connection?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 22:00:19 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6179#M540</guid>
      <dc:creator>amit_kothari</dc:creator>
      <dc:date>2024-12-09T22:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Row Number Error in MV Spark SQL</title>
      <link>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6236#M549</link>
      <description>&lt;P&gt;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/15"&gt;@amit_kothari&lt;/a&gt;&amp;nbsp; : Its via MV.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 13:27:43 GMT</pubDate>
      <guid>https://community.incorta.com/t5/data-schema-discussions/row-number-error-in-mv-spark-sql/m-p/6236#M549</guid>
      <dc:creator>nikhil_cr</dc:creator>
      <dc:date>2025-01-13T13:27:43Z</dc:date>
    </item>
  </channel>
</rss>

