<?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 create a dictionary from two variables?</title><link>https://community.appian.com/discussions/f/general/19733/how-do-i-create-a-dictionary-from-two-variables</link><description>I have an array from which I am obtaining the date field: 
 local!weeks: index( ri!casualWorkSchedule, &amp;quot;weeks&amp;quot;, {} ), 
 
 I then have a second variable for hours on which I do a calculation on the passed array: 
 
 local!proposedHours: tointeger( a!forEach</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do I create a dictionary from two variables?</title><link>https://community.appian.com/thread/77202?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 21:40:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56812bae-848e-40a0-95f8-c4be315c7423</guid><dc:creator>ireneb</dc:creator><description>&lt;p&gt;Thanks very much for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I create a dictionary from two variables?</title><link>https://community.appian.com/thread/77173?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 16:45:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c666ddc8-8106-4352-8d5b-e1f5f8b38f5f</guid><dc:creator>Praful Singhal</dc:creator><description>&lt;p&gt;/*create a cdt with three fields id, &lt;span&gt;weekEndingDate,&amp;nbsp;&lt;/span&gt;&lt;span&gt;totalHours&amp;nbsp;&lt;/span&gt;and then use that cdt&amp;nbsp; . i have attached a workable code just you need to replace the cdt name with your created cdt. Please do null handling for ri!&lt;span&gt;casualWorkSchedule&lt;/span&gt;*/&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;local!weeks: index(&lt;br /&gt; ri!casualWorkSchedule,&lt;br /&gt; &amp;quot;weeks&amp;quot;,&lt;br /&gt; {}&lt;br /&gt;),&lt;br /&gt;a!flatten(&lt;br /&gt; a!forEach(&lt;br /&gt; items: ri!casualWorkSchedule,&lt;br /&gt; expression: type!cdt(&lt;br /&gt; weekEndingDate: index(&lt;br /&gt; local!weeks,&lt;br /&gt; fv!index,&lt;br /&gt; null&lt;br /&gt; ),&lt;br /&gt; totalHours: tointeger(&lt;br /&gt; rule!CAT_calculateProposedHoursFromCasualWorkSchedule(&lt;br /&gt; tempWorkSchedule: fv!item&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I create a dictionary from two variables?</title><link>https://community.appian.com/thread/77141?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 04:56:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d113a4e0-d5ab-4f99-b250-c4c98a69a2e4</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Please check&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/20.3/fnc_system_map.html"&gt;https://docs.appian.com/suite/help/20.3/fnc_system_map.html&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/20.3/Expressions.html#dictionaries"&gt;docs.appian.com/.../Expressions.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I create a dictionary from two variables?</title><link>https://community.appian.com/thread/77140?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 04:38:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b8bb40a0-e303-45e1-81b1-1ac45f418469</guid><dc:creator>ireneb</dc:creator><description>&lt;p&gt;Further to my question above, you may wish to know what I am attempting to do.&lt;/p&gt;
&lt;p&gt;Basically, I need to calculate if the total hours for a week are greater than 36.75.&lt;/p&gt;
&lt;p&gt;Already allocated hours are sourced from a view.&amp;nbsp; Hours being assigned are sourced from a process variable as they are not stored until the process is completed.&amp;nbsp; A warning needs to be displayed prior to the process completing for allocated hours + proposed hours &amp;gt; 36.75.&lt;/p&gt;
&lt;p&gt;The total hours is already calculated in the view.&amp;nbsp; The proposed hours need to be calculated by summing each (pay code hours X sessions) where the paycode and sessions are input by the user and stored in a process variable.&lt;/p&gt;
&lt;p&gt;This is per week where there may be many weeks.&lt;/p&gt;
&lt;p&gt;Just for some clarity on what I am trying to achieve &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>