<?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>How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/discussions/f/general/23843/how-do-i-add-the-paymentamt-based-on-the-caseid</link><description>Hello Team, 
 
 I am trying to create a new view with expression rule or sql script that will include the sum(PaymentAmt) for cases where directDepositTF is 1. For example in the attached image, caseId 138465, I would like a view that sums the amount</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91916?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 19:46:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f7ed78a-0b67-467f-a3e3-21c7c88939d0</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;I might try this later. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91815?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 04:02:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3bb43cec-666c-46aa-81e0-cfb28ec0c191</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi, you can go through this link for more information about relationships in record.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/record-type-relationships.html"&gt;docs.appian.com/.../record-type-relationships.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91803?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 19:08:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b31dd70c-8c6b-4227-86aa-b744579ba083</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;You would have the view in the database and then query that view through a query rule.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91799?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 16:03:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d24eb465-0e00-40ec-8015-0049fdbad232</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Or Maybe a Query Rule can do this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91797?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 15:59:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ebe0c2e-e8a5-4b2a-bee8-42452143a271</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="sql"&gt;//How do I put this in Appian:

SELECT [caseId]
,[directDepositTF]
,[deptCaseTypeId]
      ,[caseTypeCode]
      ,[paymentFormTypeId]
,SUM([paymentAmt]) AS aggPaymentAmt
FROM [Appian_DB].[dbo].[CSO_PAYMENT_FILE_OUTPUT_VIEW]
WHERE directDepositTF = &amp;#39;1&amp;#39; AND paymentFormTypeId = &amp;#39;1&amp;#39; and recptDateTS &amp;gt;CONVERT(VARCHAR(10),GETDATE(),110) and recptDateTS &amp;lt; CONVERT(VARCHAR(10),GETDATE()+1,110)
GROUP BY [caseId],[directDepositTF],[deptCaseTypeId],[caseTypeCode],[paymentFormTypeId]&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91717?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:29:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:88dc987c-d162-4ffd-8d63-a878c3f5adc2</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Thank you &lt;a href="/members/andrewh0007"&gt;ajhick&lt;/a&gt; I will try this and let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91716?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:28:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ec6270b-183d-4793-b76b-973b61b148ff</guid><dc:creator>nicholaso0002</dc:creator><description>&lt;p&gt;Can you share more light on this with examples based on the question. Also, a link on how to implement it will be great. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91689?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 08:54:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a2d1e68-fd41-4057-abcb-02f79497f09b</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;In the recent versions of Appian that have Modern Records you can create relationships between the different Record Types and then include Custom Record Fields - i.e. values that are derived from attributes on a Record Type. You can include functions like &amp;#39;sum&amp;#39;, so this would be another way of achieving your requirement. In short this allows you to construct the kinds of functionality that &lt;a href="/members/andrewh0007"&gt;ajhick&lt;/a&gt; is describing in his SQL VIEW example -&amp;nbsp;without ever having to go to the database itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91685?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 00:26:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bd5cbf1a-fb32-47d7-8182-43cbafd5b80c</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;And for an expression rule you could use this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!queryEntity(
  entity: cons!DATA_STORE_ENTITY,
  query: a!query(
    aggregation: a!queryAggregation(
      aggregationcolumns: {
        a!queryAggregationColumn(
          field: &amp;quot;caseId&amp;quot;,
          isgrouping: true
        ),
        a!queryAggregationColumn(
          field: &amp;quot;paymentAmt&amp;quot;,
          isgrouping: false,
          aggregationfunction: &amp;quot;SUM&amp;quot;
        )
      }
    ),
    filter: a!queryFilter(
      field: &amp;quot;directDepositTF&amp;quot;,
      operator: &amp;quot;=&amp;quot;,
      value: true /*Or &amp;quot;1&amp;quot;??*/
    ),
    pagingInfo: a!pagingInfo(1, - 1)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add the paymentAmt based on the CaseId</title><link>https://community.appian.com/thread/91684?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 00:15:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3556c588-7cf7-4bbb-9e3b-e9a74261627f</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;For a view you could use this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SELECT
    `caseId`,
    SUM(`paymentAmt`)
FROM `TABLE_NAME`
WHERE
	`directDepositTF` = 1
GROUP BY `caseId`;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>