<?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>To split up dates based on frequency in Appian</title><link>https://community.appian.com/discussions/f/rules/25471/to-split-up-dates-based-on-frequency-in-appian</link><description>Hi All, 
 Assume like the user have entered the below start date and end date and also, they have selected some contracts and price groups based on the date logic. 
 Start Date: 15 th June 2022 
 End Date: 15 th July 2022 
 Now I have a table like below</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: To split up dates based on frequency in Appian</title><link>https://community.appian.com/thread/99275?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 03:52:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3dae25e8-8897-4e84-80f4-5804fa1f915b</guid><dc:creator>Jansi J</dc:creator><description>&lt;p&gt;Hello Chris, thank you so much, it is working as expected, except Semi-Annually frequency, please find the below output which I get using the code you provided,&lt;/p&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_non_value"&gt;Map&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;contract&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;priceGrp&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx-1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;frequency&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;Semi-Annually&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;startDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;1/1/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;endDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;7/31/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_non_value"&gt;Map&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;contract&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;priceGrp&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx-1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;frequency&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;Semi-Annually&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;startDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;8/1/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;endDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;12/31/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;Expected output:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_non_value"&gt;Map&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;contract&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;priceGrp&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx-1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;frequency&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;Semi-Annually&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;startDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;1/1/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;endDate&lt;span style="background-color:#ffff00;"&gt;6&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#ffff00;"&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;/30/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_non_value"&gt;Map&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;contract&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;priceGrp&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;xxx-1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;frequency&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;Semi-Annually&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;startDate&lt;span style="background-color:#ffff00;"&gt;7&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#ffff00;"&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;/1/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---last SelectableTreeNode---allow_text_highlighting"&gt;&lt;i class="SelectableTreeNode---icon SelectableTreeNode---openCloseLink"&gt;&lt;/i&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;endDate&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;12/31/2022&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Date)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To split up dates based on frequency in Appian</title><link>https://community.appian.com/thread/99252?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 18:13:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:13b89e87-bdd2-460b-a66a-c91fff8dbeb7</guid><dc:creator>Jansi J</dc:creator><description>&lt;p&gt;Many thanks Chris.&lt;/p&gt;
&lt;p&gt;I will try this out and let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To split up dates based on frequency in Appian</title><link>https://community.appian.com/thread/99251?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 18:00:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9b86fee7-4052-4c9e-af70-c9945521a72c</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Try this out for size. 4 helper rules required:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rule!chris_test_frequency_monthly(data (Any Type), startDate (Date), endDate (Date))&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!yearDiff: year(ri!endDate) - year(ri!startDate),
  local!monthDiff: (local!yearDiff) * 12 + month(ri!endDate) - month(ri!startDate) + 1,
  local!startDate: date(year(ri!startDate),month(ri!startDate),1),
  
  a!forEach(
    items: 1+enumerate(local!monthDiff),
    expression: a!map(
      contract: ri!data.contract,
      priceGrp: ri!data.priceGrp,
      frequency: ri!data.frequency,
      startDate: edate(local!startDate,fv!index-1),
      endDate: eomonth(local!startDate,fv!index-1)
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rule!chris_test_frequency_quarterly(data (Any Type), startDate (Date), endDate (Date))&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!quartersStart: {
    date(year(ri!startDate),1,1),
    date(year(ri!startDate),4,1),
    date(year(ri!startDate),7,1),
    date(year(ri!startDate),10,1)
  },
  local!startQuarter: ceiling(month(ri!startDate)/3,1),
  local!endQuarter: ceiling(month(ri!endDate)/3,1),
  local!years: year(ri!endDate)-year(ri!startDate),
  local!quarters: (local!years) * 4 + local!endQuarter - local!startQuarter + 1,
  local!outputDateStart: index(local!quartersStart,local!startQuarter,null),
  
  a!forEach(
    items: 1+enumerate(local!quarters),
    expression: a!map(
      contract: ri!data.contract,
      priceGrp: ri!data.priceGrp,
      frequency: ri!data.frequency,
      startDate: edate(local!outputDateStart,(fv!index-1)*3),
      endDate: eomonth(local!outputDateStart,((fv!index-1)*3)+2)
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rule!chris_test_frequency_semi_annually(data (Any Type), startDate (Date), endDate (Date))&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!periodStart: {
    date(year(ri!startDate),1,1),
    date(year(ri!startDate),6,1)
  },
  local!startPeriod: ceiling(month(ri!startDate)/6,1),
  local!endPeriod: ceiling(month(ri!endDate)/6,1),
  local!years: year(ri!endDate)-year(ri!startDate),
  local!periods: (local!years) * 2 + local!endPeriod - local!startPeriod + 1,
  local!outputDateStart: index(local!periodStart,local!startPeriod,null),

  a!forEach(
    items: 1+enumerate(local!periods),
    expression: a!map(
      contract: ri!data.contract,
      priceGrp: ri!data.priceGrp,
      frequency: ri!data.frequency,
      startDate: edate(local!outputDateStart,(fv!index-1)*6+(mod(fv!index+1,2))),
      endDate: eomonth(local!outputDateStart,(fv!index*6)-(mod(fv!index+1,2)))
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;rule!chris_test_frequency_annually(data (Any Type), startDate (Date), endDate (Date))&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!years: year(ri!endDate)-year(ri!startDate)+1,
  local!outputDateStart: date(year(ri!startDate),1,1),

  a!forEach(
    items: 1+enumerate(local!years),
    expression: a!map(
      contract: ri!data.contract,
      priceGrp: ri!data.priceGrp,
      frequency: ri!data.frequency,
      startDate: edate(local!outputDateStart,(fv!index-1)*12),
      endDate: eomonth(local!outputDateStart,(fv!index*12-1))
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is your main interface - starting data is shown up top, enter dates below and click Calculate. This will generate a grid below with the result. Essentially, helper rules are called for each frequency in the initial data set, they decide how many of those specific period types the dates cover and generate one row with the corresponding start/end dates per period.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!startDate,
  local!endDate,
  local!data: {
    a!map(contract: &amp;quot;xxx&amp;quot;, priceGrp: &amp;quot;xxx-1&amp;quot;, frequency: &amp;quot;Monthly&amp;quot;),
    a!map(contract: &amp;quot;xxx&amp;quot;, priceGrp: &amp;quot;xxx-2&amp;quot;, frequency: &amp;quot;Quarterly&amp;quot;),
    a!map(contract: &amp;quot;xxx&amp;quot;, priceGrp: &amp;quot;xxx-3&amp;quot;, frequency: &amp;quot;Semi-Annually&amp;quot;),
    a!map(contract: &amp;quot;xxx&amp;quot;, priceGrp: &amp;quot;xxx-4&amp;quot;, frequency: &amp;quot;Annually&amp;quot;)
  },
  local!result,

  {
    a!gridField(
      label: &amp;quot;Main Data&amp;quot;,
      data: local!data,
      columns: {
        a!gridColumn(
          label: &amp;quot;Contract Number&amp;quot;,
          value: fv!row.contract
        ),
        a!gridColumn(
          label: &amp;quot;Price GRP ID&amp;quot;,
          value: fv!row.priceGrp
        ),
        a!gridColumn(
          label: &amp;quot;Frequency&amp;quot;,
          value: fv!row.frequency
        )
      }
    ),
    a!columnsLayout(
      columns: {
        a!columnLayout(),
        a!columnLayout(
          contents: {
            a!dateField(
              label: &amp;quot;Start Date&amp;quot;,
              value: local!startDate,
              saveInto: local!startDate
            )
          }
        ),
        a!columnLayout(
          contents: {
            a!dateField(
              label: &amp;quot;End Date&amp;quot;,
              value: local!endDate,
              saveInto: local!endDate,
              validations: if(
                or(
                  rule!APN_isEmpty(local!startDate),
                  rule!APN_isEmpty(local!endDate),
                  local!endDate&amp;gt;=local!startDate
                ),
                null,
                &amp;quot;End date must be greater than start date&amp;quot;
              )
            )
          }
        ),
        a!columnLayout()
      }
    ),
    a!buttonArrayLayout(
      align: &amp;quot;CENTER&amp;quot;,
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Calculate&amp;quot;,
          disabled: or(
            rule!APN_isEmpty(local!startDate),
            rule!APN_isEmpty(local!endDate),
            local!endDate&amp;lt;local!startDate
          ),
          saveInto: {
            a!save(
              local!result,
              a!flatten(
                a!forEach(
                  items: local!data,
                  expression: {
                    choose(
                      wherecontains(fv!item.frequency,{&amp;quot;Monthly&amp;quot;,&amp;quot;Quarterly&amp;quot;,&amp;quot;Semi-Annually&amp;quot;,&amp;quot;Annually&amp;quot;}),
                      rule!chris_test_frequency_monthly(data: fv!item, startDate: local!startDate, endDate: local!endDate),
                      rule!chris_test_frequency_quarterly(data: fv!item, startDate: local!startDate, endDate: local!endDate),
                      rule!chris_test_frequency_semi_annually(data: fv!item, startDate: local!startDate, endDate: local!endDate),
                      rule!chris_test_frequency_annually(data: fv!item, startDate: local!startDate, endDate: local!endDate)
                    )
                  }
                )
              )
            )
          }
        )
      }
    ),
    
    a!gridField(
      label: &amp;quot;Updated Data&amp;quot;,
      data: local!result,
      showWhen: not(rule!APN_isEmpty(local!result)),
      columns: {
        a!gridColumn(
          label: &amp;quot;Contract Number&amp;quot;,
          value: fv!row.contract
        ),
        a!gridColumn(
          label: &amp;quot;Price GRP ID&amp;quot;,
          value: fv!row.priceGrp
        ),
        a!gridColumn(
          label: &amp;quot;Frequency&amp;quot;,
          value: fv!row.frequency
        ),
        a!gridColumn(
          label: &amp;quot;Start Date&amp;quot;,
          value: fv!row.startDate
        ),
        a!gridColumn(
          label: &amp;quot;End Date&amp;quot;,
          value: fv!row.endDate
        )
      }
    ),
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Let me know how that works out!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To split up dates based on frequency in Appian</title><link>https://community.appian.com/thread/99235?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 15:50:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d46c8d56-6fc7-4347-89e0-fa54bd7ad177</guid><dc:creator>Jansi J</dc:creator><description>&lt;p&gt;Thanks for your response Chris!!&lt;/p&gt;
&lt;p&gt;Yes your understanding is correct.&lt;/p&gt;
&lt;p&gt;Example 1:&lt;/p&gt;
&lt;p&gt;Start Date : April 15 2021;End Date : June 15 2021&lt;/p&gt;
&lt;p&gt;Case : If frequency&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Monthly &amp;gt;&amp;gt; 3 rows{1&lt;sup&gt;st&lt;/sup&gt; Apr 2021-30&lt;sup&gt;th&lt;/sup&gt; Apr 2021;1&lt;sup&gt;st&lt;/sup&gt; May 2021-31&lt;sup&gt;st&lt;/sup&gt; May 2021;1&lt;sup&gt;st&lt;/sup&gt; Jun 2021-30&lt;sup&gt;th&lt;/sup&gt; Jun 2021}&lt;/li&gt;
&lt;li&gt;Quarterly&amp;gt;&amp;gt;1 row{1&lt;sup&gt;st&lt;/sup&gt; Apr 2021-30&lt;sup&gt;th&lt;/sup&gt; Jun 2021}&lt;/li&gt;
&lt;li&gt;Semi-Annually&amp;gt;&amp;gt;1 row{1&lt;sup&gt;st&lt;/sup&gt; Jan 2021-30&lt;sup&gt;th&lt;/sup&gt; Jun 2021}&lt;/li&gt;
&lt;li&gt;Annually&amp;gt;&amp;gt;1 row{1&lt;sup&gt;st&lt;/sup&gt; Jan 2021- 31&lt;sup&gt;st&lt;/sup&gt; Dec 2021}&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Example 2:&lt;/p&gt;
&lt;p&gt;Start Date :Dec 15 2022; End Date : Jan 15 2023&lt;/p&gt;
&lt;p&gt;Case : If frequency&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Monthly&amp;gt;&amp;gt;2 rows {Dec 2022 ; Jan 2023}&lt;/li&gt;
&lt;li&gt;Quarterly&amp;gt;&amp;gt;2 rows{Oct-Dec 2022 ; Jan-Mar 2023}&lt;/li&gt;
&lt;li&gt;Semi-Annually&amp;gt;&amp;gt;2 rows{Jul-Dec 2022 ; Jan-Jun 2023}&lt;/li&gt;
&lt;li&gt;Annually&amp;gt;&amp;gt;2 rows{Jan-Dec 2022 ; Jan-Dec 2023}&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To split up dates based on frequency in Appian</title><link>https://community.appian.com/thread/99233?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 15:24:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8310723c-fdb2-4107-952c-1e3a7d21aa7d</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;I&amp;#39;m sure this is doable, but I&amp;#39;m not sure exactly how the user-entered dates affect the Start/End calculations.&amp;nbsp; If they select dates within the same month, does that only make one row for Monthly items?&amp;nbsp; If they choose April 15 to June 15, does that make 3 monthly rows for each April/May/June, surrounding their date selections?&amp;nbsp; Should Annual rows have 2 items if they choose Dec 15, 2022 to Jan 15, 2023?&amp;nbsp; If you could expand how the dates affect each Monthly/Quarterly/Semi-Annually/Annually rows that would be helpful..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>