Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Morning,
I am trying to find a way to display milestones on a chart- the problem is that I have repetitively named milestones and I have to tell the chart which to display. Here are the characteristics of an if expression I want to create:
The data would look something like this if today = 7/28/15:
Milestone | CalendarDate |
---|---|
Start | 1/1/15 |
Jump | 2/2/15 |
Jump | 3/3/15 |
Jump | 4/4/15 |
Kick | 5/5/15 |
Kick | 6/6/15 |
Kick | 7/7/15 |
Kick | 8/8/15 |
Kick | 9/9/15 |
Spin | 10/10/15 |
Spin | 11/11/15 |
Spin | 12/12/15 |
Finish | 1/1/16 |
The red highlights are the milestones I want to show in the chart:
The dimension on the chart is - Milestone and
I have started the following expression and everything is working so far, except the next (Spin in the example above), which I am trying to perform as set analysis in the last nest of the if statement:
if (count ([Milestone])=1, CalendarDate,
if (count ([Milestone])>1 and min(CalendarDate)-today()>=0, min(CalendarDate),
if (count ([Milestone])>1 and max(CalendarDate)-today()<=0, max(CalendarDate),
if (count ([Milestone])>1 and (min(CalendarDate)-today()>=0 and max(CalendarDate)-today()<=0),
Only({<CalendarDate= {">=$(= today())"}>} CalendarDate)
)
)
)
)
Any help or guidance would be greatly appreciated.
Thanks,
Vince
As other people mentioned, it may have to do with the format of your dates.
I've attached my copy so you can see what it looks like with clean data from an inline load.
The date format of the field is a four digit code
I have modified the values to:
date(CalendarDate,'M/D/YYYY') so that it matches format.
Now the Milestone shows (first time ever) - but unfortunately it is making it today's date, not the next.
WOW - it worked - i didn't need to modify my calendar date -
I needed to Floor(today()) to make it numeric.
Thank you soooooo much for your help
final script:
if (count ([Milestone])=1, CalendarDate,
if (count ([Milestone])>1 and min(CalendarDate)-today()>=0, min(CalendarDate),
if (count ([Milestone])>1 and max(CalendarDate)-today()<=0, max(CalendarDate),
Min({<CalendarDate= {">=$(= floor(today()))"}>} CalendarDate)
)
)
)
Thank you for your guidance - the matching of field types for comparison was ultimately the issue