<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Appian Queries - Null Total Count</title><link>https://community.appian.com/discussions/f/data/17492/appian-queries---null-total-count</link><description>When I run a query (r18_3 so the total count parameter doesn&amp;#39;t exist) with a!pagingInfo(1,-1), it returns total count appropriately. When I substitute a!pagingInfo(1,10), the total count is 0. Does anyone know why this occurs? Looking at the view, the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Appian Queries - Null Total Count</title><link>https://community.appian.com/thread/68951?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2019 13:40:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4e08c619-2f36-4794-802f-9bce8b4dd6b5</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Yep, if your &amp;quot;primary key&amp;quot; field isn&amp;#39;t actually unique, then you can have some strange behavior. Can you create a combined field that would work as a primary key instead? If this is a database view, you could either use the primary key of one of the&amp;nbsp;tables you queried from or create a key by combining data together. For instance, suppose I created a&amp;nbsp;database view to build a line chart that displays a monthly count of records added&amp;nbsp;I could&amp;nbsp; create a column for the primary key as a concatenation of the year and month (e.g. 201901, 201902), which should be unique.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Appian Queries - Null Total Count</title><link>https://community.appian.com/thread/68940?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 19:54:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:566b6f5f-9b54-45ce-a10f-0a8e58fb5bfd</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="33833" url="~/discussions/f/data/17492/appian-queries---null-total-count/68939"]It&amp;#39;s interesting that when the paging info is (1,-1), it handles the nulls perfectly fine.[/quote]
&lt;p&gt;yeah - i suppose in that case it&amp;#39;s probably just using the total returned data length (since it&amp;#39;s fetching everything anyway, it doesn&amp;#39;t need to do an additional call to the database to get a total count).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Appian Queries - Null Total Count</title><link>https://community.appian.com/thread/68939?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 19:52:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f41b28ae-d1b5-428e-8c6e-33465a6166af</guid><dc:creator>justinp821</dc:creator><description>&lt;p&gt;It&amp;#39;s interesting that when the paging info is (1,-1), it handles the nulls perfectly fine. I ended up using count(ri!datasubset.data) as a solution.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Appian Queries - Null Total Count</title><link>https://community.appian.com/thread/68938?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 19:51:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:923ff701-f486-4eac-a575-fcb3d2911665</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I&amp;#39;m not 100% certain what&amp;#39;s going on in your case, but your guess is probably close - as far as I&amp;#39;ve seen from personal experience, Appian expects that the column designated as &amp;quot;primary key&amp;quot; in the CDT (whether or not it&amp;#39;s actually a primary key in the DB) will be unique and populated for each row.&amp;nbsp; If that&amp;#39;s not the case with your view, I suggest trying to alter the view and/or CDT such that there can be a column which will always have a value and all values in that column will be unique.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>