<?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>Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/discussions/f/new-to-appian/34121/invalid-types-can-only-act-on-data-of-the-same-type-any-type-cdt</link><description>I wanted to filter the chart to display only &amp;quot;selected Us&amp;quot;. In othrer words, only contains&amp;quot; selected Us&amp;quot;.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129889?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 02:00:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:28b65d45-d9b8-45a8-b05e-a35a6947748b</guid><dc:creator>santhosh.rudrashetty</dc:creator><description>&lt;p&gt;As a best practice, whenever you are using comparision functions like contains() and wherecontains() always typecast them. Especially when you are dealing with local variables because they wont have any datatype by default. In the above case, you can rewrite the above contains logic like this (assuming they are integers):&lt;br /&gt;&lt;br /&gt;contains(&lt;/p&gt;
&lt;p&gt;tointeger(index(fv!item, &amp;quot;cBrandId&amp;quot;, &amp;quot;&amp;quot;)),&lt;/p&gt;
&lt;p&gt;tointeger(ri!selectedUs)&lt;/p&gt;
&lt;p&gt;)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129873?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 14:50:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:081f3c35-4a38-459c-9176-a83c0379cb4f</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Yup. So as already mentioned:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;The error itself is simply saying it can&amp;#39;t compare two&amp;nbsp;different types of data. You need to cast one (or both) of them to a common data type before they can be compared.&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129871?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 14:19:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f4171915-dc1b-4f19-a3cb-ded3f14bec55</guid><dc:creator>R5127</dc:creator><description>&lt;p&gt;Sorry, the chart doesn&amp;#39;t display with this. I don&amp;#39;t have chart yet&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129869?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 14:16:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8fd5b2e0-da14-4506-9ee1-102c705c9375</guid><dc:creator>R5127</dc:creator><description>&lt;p&gt;line number 15&amp;nbsp;&lt;span&gt; at function &amp;#39;contains&amp;#39; [line 15]: Invalid types, can only act on data of the same type (Any Type, Type CDT)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129868?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 14:14:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:92f9bd57-c749-4a71-bc06-4693397e2514</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Is the error referencing a line number in the code? The error itself is simply saying it can&amp;#39;t compare two&amp;nbsp;different types of data. You need to cast one (or both)( of them to a common data type before they can be compared. Since you mention &amp;#39;selected Us&amp;#39; my guess is the error is in Line 15 in your code block above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invalid types, can only act on data of the same type (Any Type, CDT)</title><link>https://community.appian.com/thread/129867?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 14:05:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2ad2ae53-c073-44f9-9a3f-23269e7fa533</guid><dc:creator>Dhananjay Kumar</dc:creator><description>&lt;p&gt;Can you post the screenshot of chart as well, its hard to imagine?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>