I'm trying to define a colour to points based on their timeperiod.
Basically what im trying to achieve is this:
| MonthBefore | < 'colour1' < | beginDate | <= 'colour 2' <= | endDate | < 'colour3' < | WeekAfter|
everything else: 'colour 4'
Everything seems to be working as intended up until the colour 3..
When I check the Symbol options I notice only 8 features are present, while 10 are included in the feature layer.
No filters are applied.
When Symbology based on location is applied, all features are shown.
Any reason as to why and what is happening?
ps. I triple checked if all possibilities are available.
Script |
---|
var nu = now();
|
Solved! Go to Solution.
I tested your code using some various dates and it does return all values
var nu = now();
var begin = Date(2020,6,1);
var eind = Date(2020,6,25); //returns 'Groen', 2020/6/20 returns 'Grijs', 2020/6/31 returns 'Rood'. Changing the month in begin and eind to '7' returns 'Oranje'
var MaandErvoor = DateAdd(begin, -1, 'month');
var WeekErna = DateAdd(eind, 7, 'days');
var Kleur = When(
nu > MaandErvoor && nu < begin, 'Oranje',
nu <= eind, 'Rood',
nu < WeekErna, 'Groen',
"Grijs"
);
return Kleur
I tested your code using some various dates and it does return all values
var nu = now();
var begin = Date(2020,6,1);
var eind = Date(2020,6,25); //returns 'Groen', 2020/6/20 returns 'Grijs', 2020/6/31 returns 'Rood'. Changing the month in begin and eind to '7' returns 'Oranje'
var MaandErvoor = DateAdd(begin, -1, 'month');
var WeekErna = DateAdd(eind, 7, 'days');
var Kleur = When(
nu > MaandErvoor && nu < begin, 'Oranje',
nu <= eind, 'Rood',
nu < WeekErna, 'Groen',
"Grijs"
);
return Kleur
I got it. Thank you for the helpful post. word wipe
And I want to share this http://elena-therapy.ch/