How do i get a list of months that follow given a date

Hi. I want to implement a graph that has Loan amount on the y axis and months on the horizontal x axis.

Given the following 1 record from an entity

-Loan amount

-Created date (Date)

-Loan term which is an integer representing months eg 6, 12, 24 and 36 months

If a loan is 6 months starting from the created date eg January then the graph must have 6 months jan-june.

The graph needed is attached below. 

To get the month i am saying FormatDate( created_date, "MMMM") but it only returns the first month. How best can i get a list of the next 5 months so that i can display them.


Hi,


Can you use Loan term field to loop from 1 to loan term and add 1 month in created date every time and append in list with format.



Thanks!!

Hi Rudo,

You can use the functions: 

  • Month(created_date) to get their months
  • AddMonths(created_date, x)

Adding an attribute in your aggregate to get this calculated together your data.

Solution

Ajay Sharma wrote:

Hi,


Can you use Loan term field to loop from 1 to loan term and add 1 month in created date every time and append in list with format.



Thanks!!

 

 Please look at snapshot

hope this will help you

Solution

Ajay Sharma wrote:

Ajay Sharma wrote:

Hi,


Can you use Loan term field to loop from 1 to loan term and add 1 month in created date every time and append in list with format.



Thanks!!

 

 Please look at snapshot

hope this will help you

 

 Thank you. I tried to implement this but its not working. Where am i missing it? See attached my screenshots. The formatDate function gives me errors as well




RUDO MURIEL MUNYAVI wrote:

Ajay Sharma wrote:

Ajay Sharma wrote:

Hi,


Can you use Loan term field to loop from 1 to loan term and add 1 month in created date every time and append in list with format.



Thanks!!

 

 Please look at snapshot

hope this will help you

 

 Thank you. I tried to implement this but its not working. Where am i missing it? See attached my screenshots. The formatDate function gives me errors as well




 

 your output variable Months should be a Text List data type.

see snapshot 

Thank you so much it worked. Now i am having an issue displaying the list in a graph. I want the list of months to be on the horizontal x-axis but it only pulls 1 record.

RUDO MURIEL MUNYAVI wrote:

Thank you so much it worked. Now i am having an issue displaying the list in a graph. I want the list of months to be on the horizontal x-axis but it only pulls 1 record.

 Can you share OML file so that I can check what is the issue now

 

Sure, i have attached the oml file

Ajay Sharma wrote:

RUDO MURIEL MUNYAVI wrote:

Thank you so much it worked. Now i am having an issue displaying the list in a graph. I want the list of months to be on the horizontal x-axis but it only pulls 1 record.

 Can you share OML file so that I can check what is the issue now

 

 

 

Ajay Sharma wrote:

RUDO MURIEL MUNYAVI wrote:

Thank you so much it worked. Now i am having an issue displaying the list in a graph. I want the list of months to be on the horizontal x-axis but it only pulls 1 record.

 Can you share OML file so that I can check what is the issue now

 

 Hi,how are you? Did you manage to look at the oml file by any chance. Just to get a list of months in the appended list to show on the x-axis

 

RUDO MURIEL MUNYAVI wrote:

Ajay Sharma wrote:

RUDO MURIEL MUNYAVI wrote:

Thank you so much it worked. Now i am having an issue displaying the list in a graph. I want the list of months to be on the horizontal x-axis but it only pulls 1 record.

 Can you share OML file so that I can check what is the issue now

 

 Hi,how are you? Did you manage to look at the oml file by any chance. Just to get a list of months in the appended list to show on the x-axis

 

 

 Hi Rudo,


I have seen code but there are few changes you need to do to show records in Graph.
you are trying to get months only for current month but you need to show all records of Loan Entity.
You need change aggragate to make correct data points for graph.


Thanks!!