To split up dates based on frequency in Appian

Certified Senior Developer

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: 15th June 2022

End Date: 15th July 2022

Now I have a table like below with all the selected data,

Contract number

Price grp id

Frequency

xxx

xxx-1

Monthly

xxx

xxx-2

Quarterly

xxx

xxx-3

Semi-Annually

xxx

xxx-4

Annually

 

My scenario is like I have to check the frequency from above table(cdt) and split it into multiple rows based on the date range (Start Date & End Date) and update in another table(cdt),please refer the resulting expectation,

Case 1:

Frequency: Monthly>>then 2 rows >>1st row: {Start Date: 1st Jun 2022 – 30th Jun 2022}>>2nd row: {Start Date: 1st Jul 2022 – 31st Jul 2022}

Case 2:

Frequency: Quarterly>>then 2 rows >>1st row: {Start Date: 1st Apr 2022 – 30th Jun 2022}>>2nd row: {Start Date: 1st Jul 2022 – 30th Sep 2022}

Case 3:

Frequency: Semi-Annually>>then 2 rows >>1st row: {Start Date: 1st Jan 2022 – 30th Jun 2022}>>2nd row: {Start Date: 1st Jul 2022 – 31st Dec 2022}

Case 4:

Frequency: Annually>>then 1 row>>{Start Date: 1st Jan 2022 – 31st Dec 2022}

Resulting CDT:

Contract Number

Price Grp Id

Frequency

Start Date

End Date

xxx

xxx-1

Monthly

1st Jun 2022

30th Jun 2022

xxx

xxx-1

Monthly

1st Jul 2022

31st Jul 2022

xxx

xxx-2

Quarterly

1st Apr 2022

30th Jun 2022

xxx

xxx-2

Quarterly

1st Jul 2022

30th Sep 2022

xxx

xxx-3

Semi-Annually

1st Jan 2022

30th Jun 2022

xxx

xxx-3

Semi-Annually

1st Jul 2022

31st Dec 2022

xxx

xxx-4

Annually

1st Jan 2022

31st Dec 2022

 

Is it possible to do this kind of split up for dates based on frequency in Appian Expression Rule. Could you please help me.

Thanks in Advance.

  Discussion posts and replies are publicly visible