Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I need to get the difference between two dates : Today and my date field, the result should be in days
My date field has this format 201610 (YYYYMM)
and then I have to put the result in intervals like this :
P1 <30 days |
P2 30-60 |
P3 61-90 |
P4 91-120 |
P5 121-150 |
P6 151-180 |
P7 181-360 |
P8 E 1an-2ans |
P9 E 2ans-3ans |
P10 E 3ans-4ans |
P11 E 4ans-5ans |
P12 E 5ans-6ans |
P13 E 6ans-7ans |
P14 E 7ans-8ans |
P15 E 8ans-9ans |
P16 E 9ans-10ans |
P17 > 3600 |
Any idea please.
Thanks in advance.
Your date include any day information or does it just include Year and Month information? Plan is to calculate day difference from the start of the month and today?
yes. I just had the year and month in my date
I think the difference should be easy
Today() - Date#(DateField, 'YYYYMM')
and then bucketing can be done using if statement
If(Today() - Date#(DateField, 'YYYYMM') < 30, Dual('P1 <30 days', 1),
If(Today() - Date#(DateField, 'YYYYMM') < 60, Dual('P2 30-60 days', 2),
and so on....
Hi Wiem,
Check this example, please.
Regards
Miguel del Valle
Thank you guys. I appreciate your help. Will try and let you know