Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem related to app development, I have a delivery date field which is used to calculate the next approximate delivery date which works in a way that next expected should be previous delivery date + 365 days, which means that if the first delivery date for the user is 1/1/2011 the next delivery date should be 1/1/2012, giving us 1 expected delivery instance.
I need to populate this to the current year, i.e the user would be having 12 instances each corresponding to 1/1/2012, 1/1/2013, and so on till 1/1/2023. I am little unsure about how to achieve this. Also, I have to do this for all the user IDs.
The model summary is like this...the table consists of the delivery date along with the user ID.
Any help would be appreciated. Thanks in Advance.
@deepanshuSh try below
Load USerID,
DeliveryDate,
AddYears(DeliveryDate,IterNo()-1) as NextDeliveryDate
FROM Source
while AddYears(DeliveryDate,IterNo()-1) <= Today();
@deepanshuSh try below
Load USerID,
DeliveryDate,
AddYears(DeliveryDate,IterNo()-1) as NextDeliveryDate
FROM Source
while AddYears(DeliveryDate,IterNo()-1) <= Today();
Thanku @Kushal_Chawda this what I was looking for, I was just missing the addyears function to the whole logic, +365 was not working properly.