Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculate correct date

MK_DUSI
6 - Meteoroid

Need to calculate a date based on certain logic. Please check the attached query which gives the conditions.

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@MK_DUSI 
You said "Annual - Since the billing would have been done at the start, the end date will be 1st June 2026".

But you menitoned that "The billing happens 30 Days in advance in case of monthly frequency and 90 days in advance in case of all other frequencies",

So for annual, it should not be Nov 1st?

 

MK_DUSI
6 - Meteoroid

90 days in advance of the start date. If the period is from 1st June, 2025 - 31st May, 2026, billing will happen in March, 2025.

Qiu
21 - Polaris
21 - Polaris

Can you try a bit more to elobrate your logic here?

You just mentioned the input and output, and logic in between is omitted, in my view.

AlteryxTrev
10 - Fireball

@MK_DUSI , let me know if I misunderstood, but I believe you want to calculate the Contract End Date by adding time to the Start Date, and the Bill Date by subtracting time from it. Here’s how:

 

- Convert contract terms into a number of months.

- Use DateTimeAdd() to add/subtract time. The function takes: (1) start date, (2) number of units, (3) unit type (IE "months" or "days").

- Add months for the End Date, subtract days for the Bill Date.

 

I have attached the workflow I used.

 

In the event it helps, I've also created a video response illustrating the above and it can be found here: https://youtu.be/C2im_hMYV54

Labels
Top Solution Authors