Hi Community,
Edit/Added:
I have added a sample oml file. Inside, i have 2 aggregates - Products, Month
In the screen 'Previous6Months', i did not add any UI. I only fetch data from database, to combine the 2 aggregates which i had created.
Had added a new Attribute, Month_Year. This allows me to get the Month/Year for the product, which i think had solved part of my problem.
However, in my actual app, i need to do a count of the total items. Can i really combined this 2 requirements in a single aggregate, or there is a need to call the aggregate twice, 1 to fetch the total count, and 1 to group the items. Because eventually, i will be using Advanced Excel Forge, to create the populating the following table, so that i can create a chart
Apologise for suddenly adding in a lot more requirements. Thank you
Original Question:
I want to to get the actual month/year of the previous 6 months from current date.
I have a Month aggregate in my Entities, which shows the following values,
Does anybody knows how i can achieve my intended results?
Thank you.
Hi,
You don't need an aggregate, you can built either a client or server action that appends the following 6 expressions to a output list parameter of time text:
See attached module.
If you need this list just on screen use the Client action to save you a round trip to the server. You can load the list in a local screen variable on OnIntialize and then use it everywhere as source on your screen.
Regards,
Daniel
If you want my sample actions to be more generic, you could have an input parameter NoOfMonths, and use a ForEach to append the number of months to the list.
btw. try to copy/paste your reply in chatgpt, the reply is pretty much what I shared in the OML.
Hi Daniël,
Thank you for your reply. I want to said, i learn my lesson from the way i asked my question in the forum.
On hindsight, i thought i was struck with getting the previous 6 months, with the correct year. After posting my original question, i went back to work on this issue, and realise that i can get it by adding a new attribute to retrieve it. Reason why i only asked part of my question, was really because i thought after solving this part, i can work on the rest of the issues and requirements myself (Trying not to be spoon-fed also, part of my learning process)
But one thing leads to another...and my requirements can't be 'unlinked', need to address them together.
And the time needed to create my sample OML, so that i can illustrate things more clearly, so my edited question took some time for me to post.
So end up, the replies to my original question might have really solved the issue, but on the greater scale of things, it might not work.
Thanks!
Hi @Jun Mun Chan ,
Could you please share your OML file with me? I will review it and get back to you promptly.
Thanks,
Vipin Yadav
Hi @Jun Mun Chan,
Apply this filter and try:
AddMonths(CurrDate(),-6) <= CurrDateTime()
Hope this will help you!!
Rajat