Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am tryin to create an interval dimension for number of months derived from a number of days field as such:
Number of months
So far I've managed to have this result:
I have a problem with the range
Below is the loading script:
If(NB_DAYS <= 30,
'<1',
If(NB_DAYS < 210,
Replace(Class (NB_DAYS/30 ,1),'<= x <','-'),
If(NB_DAYS >= 210 and NB_DAYS<420,Replace( Class (NB_DAYS/30 ,7) ,'<= x <','-') ,
If(NB_DAYS >= 420 and NB_DAYS <720,
Replace( Class (NB_DAYS/30 ,14) ,'<= x <','-'),
If(NB_DAYS >= 360 and NB_DAYS < 1080,
Replace(Class(NB_DAYS/30,12),'<= x <','-'),
If(NB_DAYS >= 1080, '+36')
)
)
)
)) as NB_MONTHS
Is there any way to get this result.
Thank you in advance.
try below
=if(NB_DAYS>= (30*36) , '+36'
,if(NB_DAYS>= (30*24) , '24-36'
,if(NB_DAYS>= (30*14) , '14-24'
,if(NB_DAYS>= (30*7) , '7-14'
,if(NB_DAYS<= (30) , '<1' , Replace(Class (NB_DAYS/30 ,1),'<= x <','-') )))))
try below
=if(NB_DAYS>= (30*36) , '+36'
,if(NB_DAYS>= (30*24) , '24-36'
,if(NB_DAYS>= (30*14) , '14-24'
,if(NB_DAYS>= (30*7) , '7-14'
,if(NB_DAYS<= (30) , '<1' , Replace(Class (NB_DAYS/30 ,1),'<= x <','-') )))))
Hello,
Thanks for your help, it worked !