<?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>Computing not null values in a CDT</title><link>https://community.appian.com/discussions/f/data/11928/computing-not-null-values-in-a-cdt</link><description>Hi, 
 I have a CDT which has around 50 attributes, I am required to find the count of not null attributes in my CDT. Is there a way I can do this by not creating a counter which would get updated after 70 if-else checks? 
 For Example: 
 Employee_cdt</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/119342?ContentTypeID=1</link><pubDate>Sat, 16 Sep 2023 09:54:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:30b2e67a-b389-41f4-9e11-9765955e1ae2</guid><dc:creator>aswinkarthikn8741</dc:creator><description>&lt;p&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f602.svg" title="Joy"&gt;&amp;#x1f602;&lt;/span&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f602.svg" title="Joy"&gt;&amp;#x1f602;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/119297?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2023 09:52:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2eb4bf99-fa7d-4553-a8fa-fa426ec13a61</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1694771518541v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/119295?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2023 09:41:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ef02fd6-ff4e-434b-8a41-adcc1d59f5af</guid><dc:creator>anmolvijayvergiya</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/6864.Screenshot-2023_2D00_08_2D00_23-152716.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/119276?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2023 07:31:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9dc411e3-4b21-43d7-a610-655e47ee091f</guid><dc:creator>scottwillmon07</dc:creator><description>&lt;p&gt;Sorry you are giving&amp;nbsp;values which are output of null values, he asked for not null values&lt;br /&gt;&lt;br /&gt;a!localVariables(&lt;br /&gt; local!CDT: {&lt;br /&gt; fName: &amp;quot;Abc&amp;quot;,&lt;br /&gt; lName: &amp;quot;Def&amp;quot;,&lt;br /&gt; mName: &amp;quot;&amp;quot;,&lt;br /&gt; empId: 1234,&lt;br /&gt; empDept: &amp;quot;&amp;quot;&lt;br /&gt; },&lt;br /&gt; a!forEach(&lt;br /&gt; items: {&lt;br /&gt; &amp;quot;fName&amp;quot;,&lt;br /&gt; &amp;quot;lName&amp;quot;,&lt;br /&gt; &amp;quot;mName&amp;quot;,&lt;br /&gt; &amp;quot;empId&amp;quot;,&lt;br /&gt; &amp;quot;empDept&amp;quot;&lt;br /&gt; },&lt;br /&gt; expression: if(&lt;br /&gt; a!isNotNullOrEmpty(index(local!CDT, fv!item , null)),&lt;br /&gt; fv!item,&lt;br /&gt; {}&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;This works&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/52912?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2018 19:30:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a64fec8-3798-43f9-a3ce-b74d3ad8dad9</guid><dc:creator>Ranveer</dc:creator><description>Hi Arjun,&lt;br /&gt;
&lt;br /&gt;
I understood your question. The result should me mName and empDept correct?&lt;br /&gt;
You have to do take all columns/attributes name as array and perform below small line of code&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!CDT: {fName:&amp;quot;Abc&amp;quot;,lName:&amp;quot;Def&amp;quot;,mName:&amp;quot;&amp;quot;,empId:1234,empDept:&amp;quot;&amp;quot;},&lt;br /&gt;
  a!forEach(&lt;br /&gt;
    items: {&amp;quot;fName&amp;quot;, &amp;quot;lName&amp;quot;, &amp;quot;mName&amp;quot;, &amp;quot;empId&amp;quot;, &amp;quot;empDept&amp;quot;},&lt;br /&gt;
    expression: if(&lt;br /&gt;
      rule!APN_isBlank(index(local!CDT, fv!item, null)),&lt;br /&gt;
      fv!item,&lt;br /&gt;
      {}&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
this will give desired out put.&lt;br /&gt;
	&lt;br /&gt;
List of Text String: 2 items&lt;br /&gt;
    &amp;quot;mName&amp;quot;&lt;br /&gt;
    &amp;quot;empDept&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/52752?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 16:42:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:37434290-d692-49b3-b6d9-5d38fdf675ac</guid><dc:creator>Ravi Roshan</dc:creator><description>Is below your requirement?&lt;br /&gt;
&lt;br /&gt;
Input: Employee_cdt { fName:&amp;quot;Abc&amp;quot;,lName:&amp;quot;Def&amp;quot;,mName:&amp;quot;&amp;quot;,empId:1234,empDept:&amp;quot;&amp;quot;}&lt;br /&gt;
Output: 3 or {&amp;quot;fName&amp;quot;,&amp;quot;lName&amp;quot; , &amp;quot;empId&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
Please check the below code:&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
  local!empCDT: {&lt;br /&gt;
    name: &amp;quot;Ravi&amp;quot;,&lt;br /&gt;
    email: &amp;quot;rr@gmail.com&amp;quot;,&lt;br /&gt;
    phone: 123456,&lt;br /&gt;
    age:&amp;quot;&amp;quot;,&lt;br /&gt;
    gender: &amp;quot;M&amp;quot;,&lt;br /&gt;
  },&lt;br /&gt;
  local!cdtAttributes: {&amp;quot;name&amp;quot;, &amp;quot;email&amp;quot;,&amp;quot;phone&amp;quot;,&amp;quot;age&amp;quot;,&amp;quot;gender&amp;quot;},&lt;br /&gt;
  local!notNullAttributes: apply(&lt;br /&gt;
    rule!test_checkAttriuteValue(&lt;br /&gt;
      cdt: local!empCDT,&lt;br /&gt;
      attribute: _&lt;br /&gt;
    ),&lt;br /&gt;
    local!cdtAttributes&lt;br /&gt;
  ),&lt;br /&gt;
  local!notNullAttributes&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
/* Definition of rule!test_checkAttriuteValue */&lt;br /&gt;
&lt;br /&gt;
/* This rule have 2 parameters, cdt and attribute*/&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
  local!attributeValue: index(&lt;br /&gt;
    ri!cdt,&lt;br /&gt;
    ri!attribute,&lt;br /&gt;
    null&lt;br /&gt;
  ),&lt;br /&gt;
  if(&lt;br /&gt;
    isnull(local!attributeValue),&lt;br /&gt;
    ri!attribute,&lt;br /&gt;
    null&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/52750?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 14:02:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a67db17a-978e-4f64-b77f-fb9f5d9458c1</guid><dc:creator>harrisont606</dc:creator><description>You could make a rule that converts your CDT into a list of fields, then filter the list on isnull and count the result&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/52749?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 13:40:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8c2d2ed-e5f2-4b4a-8e7f-2b135d071f6b</guid><dc:creator>sahilb346</dc:creator><description>Hello Arjun,&lt;br /&gt;
&lt;br /&gt;
If you only want to fetch the details which are having all values (not contain null).&lt;br /&gt;
&lt;br /&gt;
Then use logicalExpression:-&lt;br /&gt;
logicalExpression: a!queryLogicalExpression(&lt;br /&gt;
        operator: &amp;quot;AND&amp;quot;,&lt;br /&gt;
        filters:{&lt;br /&gt;
          a!queryFilter(&lt;br /&gt;
            field:&amp;quot;fieldA&amp;quot;,&lt;br /&gt;
            operator:&amp;quot;not null&amp;quot;&lt;br /&gt;
            &lt;br /&gt;
          ),&lt;br /&gt;
          a!queryFilter(&lt;br /&gt;
            field:&amp;quot;fieldB&amp;quot;,&lt;br /&gt;
            operator:&amp;quot;not null&amp;quot;&lt;br /&gt;
          )........&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
then you will only get the value with the fields you mentioned not null.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Computing not null values in a CDT</title><link>https://community.appian.com/thread/52745?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 08:39:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2826db3d-092e-4438-b59f-c283d0135630</guid><dc:creator>lokeshk</dc:creator><description>can you simply use query entity with logical filters applied with &amp;#39;AND&amp;#39; and for all fields use operator &amp;#39;not null or &amp;lt;&amp;gt;&amp;#39;, i think in this way you can fetch only those data which have all fields available&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>