<?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>Table function</title><link>https://community.appian.com/discussions/f/data/25450/table-function</link><description>Hello everyone, 
 I have a question that table function is created in the database with set of columns and How will I use the table function in appian with some parameters? 
 Can anyone please help me to further proceed? 
 Thanks in advance.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Table function</title><link>https://community.appian.com/thread/99312?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 14:36:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df2b9357-445f-4057-afdc-626f32a5dce7</guid><dc:creator>sid</dc:creator><description>&lt;p&gt;Hi yes&amp;nbsp;&lt;a class="internal-link view-user-profile" href="/members/deepakg1538"&gt;deepakg1538&lt;/a&gt;&amp;nbsp;I have used the same query rule and but my requirement is to get the same grid at cust level in that how would I modify the above shared code ? and on click of dynamic link counts as i said need to display the other grid which data is coming from the other view.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99287?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 08:49:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a6a430b-116c-407f-8fe6-b16db7677b08</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;I think you can use your condition based on your&amp;nbsp;selectedItemType_txt variable. Please use apply when functionality into query filters of querylogicalexpression.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: a!queryEntity(
    entity: cons!CDU_TRACK_ITEMS_DSE,
    query: a!query(
      pagingInfo: a!pagingInfo(1, - 1),
      logicalExpression: a!queryLogicalExpression(
        operator: &amp;quot;AND&amp;quot;,
        filters: {
          a!queryFilter(
            field: &amp;quot;id&amp;quot;,
            operator: &amp;quot;=&amp;quot;,
            value: 1,
            applyWhen: ri!selectedItemType_txt = &amp;quot;1&amp;quot;
          ),
          a!queryFilter(
            field: &amp;quot;id&amp;quot;,
            operator: &amp;quot;=&amp;quot;,
            value: 2,
            applyWhen: ri!selectedItemType_txt = &amp;quot;2&amp;quot;
          ),
          a!queryFilter(
            field: &amp;quot;id&amp;quot;,
            operator: &amp;quot;=&amp;quot;,
            value: 3,
            applyWhen: ri!selectedItemType_txt = &amp;quot;3&amp;quot;
          ),
          a!queryFilter(
            field: &amp;quot;id&amp;quot;,
            operator: &amp;quot;=&amp;quot;,
            value: 4,
            applyWhen: ri!selectedItemType_txt = &amp;quot;4&amp;quot;
          )
        }
      )
    )
  ).data,
  local!data
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the above code, i fetch the data based on the variable.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99282?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 07:40:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d4c15cf-de5f-4919-abfd-42d2251a34e6</guid><dc:creator>sid</dc:creator><description>&lt;p&gt;okay thanks for your reply chris, I am facing difficulties while doing the developement that I will be sharing my code here&lt;pre class="ui-code" data-mode="text"&gt;a!gridField(
  labelPosition: &amp;quot;COLLAPSED&amp;quot;,
  spacing: &amp;quot;DENSE&amp;quot;,
  
  data: ri!ReportCountsViewData_cdt,
  columns: {
    a!gridColumn(
      label: &amp;quot;Summary&amp;quot;,
      value: fv!row.reportName_txt
    ),
    a!gridColumn(
      align: &amp;quot;CENTER&amp;quot;,
      label: &amp;quot;Due in 60 days&amp;quot;,
    
      value: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!row.due60Days_int,
          linkStyle: &amp;quot;STANDALONE&amp;quot;,
          link: a!dynamicLink(
            label: fv!row.due60Days_int,
            value: fv!row.due60Days_int,
            saveInto: {
              a!save(
                ri!selectedItemType_txt,
                &amp;quot;Due in 60 days&amp;quot;
              ),
              a!save(
                ri!selectedItemReportType_txt,
                fv!row.reportName_txt
              )
            },
            showWhen: and(
              not(
                isnull(
                  tointeger(
                    fv!row.due60Days_int
                  )
                )
              ),
              tointeger(
                fv!row.due60Days_int
              ) &amp;lt;&amp;gt; 0
            )
          )
        )
      )
    ),
    a!gridColumn(
      align: &amp;quot;CENTER&amp;quot;,
      label: &amp;quot;Due in 30 days&amp;quot;,
     
      value: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!row.due30Days_int,
          linkStyle: &amp;quot;STANDALONE&amp;quot;,
          link: a!dynamicLink(
            label: fv!row.due30Days_int,
            value: fv!row.due30Days_int,
            saveInto: {
              a!save(
                ri!selectedItemType_txt,
                &amp;quot;Due in 30 days&amp;quot;
              ),
              a!save(
                ri!selectedItemReportType_txt,
                fv!row.reportName_txt
              )
            },
            showWhen: and(
              not(
                isnull(
                  tointeger(
                    fv!row.due30Days_int
                  )
                )
              ),
              tointeger(
                fv!row.due30Days_int
              ) &amp;lt;&amp;gt; 0
            )
          )
        )
      )
    ),
    a!gridColumn(
      align: &amp;quot;CENTER&amp;quot;,
      label: &amp;quot;Past Due in 1-30 days&amp;quot;,
      
      value: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!row.pastdue30Days_int,
          linkStyle: &amp;quot;STANDALONE&amp;quot;,
          link: a!dynamicLink(
            label: fv!row.pastdue30Days_int,
            value: fv!row.pastdue30Days_int,
            saveInto: {
              a!save(
                ri!selectedItemType_txt,
                &amp;quot;Past Due in 1-30 days&amp;quot;
              ),
              a!save(
                ri!selectedItemReportType_txt,
                fv!row.reportName_txt
              )
            },
            showWhen: and(
              not(
                isnull(
                  tointeger(
                    fv!row.pastdue30Days_int
                  )
                )
              ),
              tointeger(
                fv!row.pastdue30Days_int
              ) &amp;lt;&amp;gt; 0
            )
          )
        )
      )
    ),
    a!gridColumn(
      align: &amp;quot;CENTER&amp;quot;,
      label: &amp;quot;Past Due in 30+ days&amp;quot;,
     
      value: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!row.pastdueOver30Days_int,
          linkStyle: &amp;quot;STANDALONE&amp;quot;,
          link: a!dynamicLink(
            label: fv!row.pastdueOver30Days_int,
            value: fv!row.pastdueOver30Days_int,
            saveInto: {
              a!save(
                ri!selectedItemType_txt,
                &amp;quot;Past Due in 30+ days&amp;quot;
              ),
              a!save(
                ri!selectedItemReportType_txt,
                fv!row.reportName_txt
              )
            },
            showWhen: and(
              not(
                isnull(
                  tointeger(
                    fv!row.pastdueOver30Days_int
                  )
                )
              ),
              tointeger(
                fv!row.pastdueOver30Days_int
              ) &amp;lt;&amp;gt; 0
            )
          )
        )
      )
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I need to do same summary report at cust level(view is created at unique cust level and taking care of the counts that is mentioned in the code).How will I modify the code at unique cust level and on click of counts the new grid (grid is different based on some conditions)has to be display. can anyone help on this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99231?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 15:17:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ea324d5-10be-43d7-afdf-a45ef2a463e2</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Additionally, you do not have to create an entire new column to add a unique column into a view.&amp;nbsp; For example in MSSQL, you can add a unique column on the fly with the ROW_NUMBER() function, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="sql"&gt;SELECT TOP (100) PERCENT ROW_NUMBER() OVER (ORDER BY id DESC) AS Row, 
step,requestNumber,requestStartTime
from tblCOE_SAMPLE_TABLE&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99188?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 07:39:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ce79eb8-057f-4465-b0f8-c723c690d189</guid><dc:creator>sid</dc:creator><description>&lt;p&gt;okay thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99186?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 07:23:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad373c6b-8beb-4401-94d2-78552561cb48</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;Please create primary key for a column for example, create a new column with name ID and makeit primary key.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99183?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 06:58:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:580ccfdf-18f1-4345-a089-03411a09e43b</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Did you try to follow the advised steps in the error message?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99177?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 06:47:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c53d0bc9-30a7-4c4a-ae0c-1288e3d7734b</guid><dc:creator>sid</dc:creator><description>&lt;p&gt;I am getting the error while creating new Data type&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/Error-_2D00_CDT-.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99135?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2022 15:14:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5fd6b32-6162-4a44-a834-c82c4e60d389</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;If you want to obtain data from a Table-valued Function in your database, you can create a view that queries the function, and set a data type / data store up on the view, same way as you would for a normal table.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I do this in one scenario where a report is generated by a function that creates/returns a temporary table, ended up being better for performance this way in my scenario, where lots of data is aggregated for a weekly summary.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="sql"&gt;CREATE view [dbo].[VIEW_FROM_FUNCTION]
as

select 
[Col1],
[Col2]
/*etc*/
from dbo.fn_YOUR_TABLE_VALUED_FUNCTION()

GO
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99130?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2022 13:27:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b6f2f16-0203-4177-9275-824bc077419f</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;I think you want to use your table into Appian to either fetch the data or update the data. If yes, then you have to create the CDT by using create from existing Table or view option into Data type and post that you have to provide the datastore name and the table name and after that create a constant to use that CDT into queryEntity or writetoDatastoreEntity function to fetch or update the data respectively.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Table function</title><link>https://community.appian.com/thread/99113?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2022 09:03:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:298b952d-f391-462c-acb8-a4cda46c6485</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;For me, it is pretty much unclear what you want to achieve. Can you give us a few&amp;nbsp;more details?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>