Arcade Expression symbology

1016
3
Jump to solution
07-29-2020 07:48 AM
MartijnJansma
New Contributor III

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();
var begin = $feature["Begin_Datum"];
var eind = $feature["Eind_Datum"];
var MaandErvoor = DateAdd(begin, -1, 'month');
var WeekErna = DateAdd(eind, 7, 'days');


var Kleur = When(
nu > MaandErvoor && nu < begin, 'Oranje',
nu >= begin && nu <= eind, 'Rood',
nu > eind && nu < WeekErna, 'Groen',
"Grijs"
);

return Kleur

1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

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‍‍‍‍‍‍‍‍‍‍‍‍‍‍

View solution in original post

3 Replies
KenBuja
MVP Esteemed Contributor

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‍‍‍‍‍‍‍‍‍‍‍‍‍‍
oceanicdivorce
New Contributor

I got it. Thank you for the helpful post. word wipe

0 Kudos
Savox
by
New Contributor

And I want to share this http://elena-therapy.ch/

0 Kudos