Symbology: How can I make a symbol to change color based on overdue date value

5355
14
Jump to solution
02-10-2015 12:10 AM
JohanLundgren
Occasional Contributor

I'm exploring symbology with ArcMAp 10.2. I created a feature class and it consists of a field called EndDate of type Date. Next, I would like to create a layer and configure symbology, so that the symbol color changes to red once the date is overdue.

I opened the Layer Properties dialog and the tab Symbology. In the 'Show section, you find Quantities and 'Graduated colors'. But my field (EndDate of data type Date) is not shown in the field called 'Value'.

 

Any ideas about how I can solve this is very much appriciated.

Are there more possibilities with symbology in ArcMap 10.3?

//Johan

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

Hi Johan,

Thank you for the information.

You can create a new field with datatype Long in attribute table. In its field calculator, paste the following

Int (Left( [EndDate], 4 ) & Mid( [EndDate], 6, 2 ) &Right( [EndDate], 2  )  )

Then use the above  field to symbolize the data.

Note: The EndDate Format is in YYYY-MM-DD format.

The field name of your EndDate field is "EndDate".

Hope it will solve the issue.

Thanks,

Jay



Think Location

View solution in original post

14 Replies
JayantaPoddar
MVP Esteemed Contributor

Hi Johan,

What is the format of your EndDate field values (e.g. MM/DD/YYYY)?



Think Location
0 Kudos
JohanLundgren
Occasional Contributor

I would like to have the ISO format: YYYY-MM-DD

//Johan

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Hi Johan,

Thank you for the information.

You can create a new field with datatype Long in attribute table. In its field calculator, paste the following

Int (Left( [EndDate], 4 ) & Mid( [EndDate], 6, 2 ) &Right( [EndDate], 2  )  )

Then use the above  field to symbolize the data.

Note: The EndDate Format is in YYYY-MM-DD format.

The field name of your EndDate field is "EndDate".

Hope it will solve the issue.

Thanks,

Jay



Think Location

View solution in original post

JohanLundgren
Occasional Contributor

Many thanks for your help Jay!

I have two fields now EndDate and CalculatedEndDate. The field CalcaulatedEndDate is added with your code, as shown above. When entering and saving a value like 2015-02-10 in EndDate it shows <null> in CalculatedEndDate. Is that the correct result?

Also, do you have any tips on where I add a calculation to show a symbol in red color on overdue, by using my new field CalculatedEndDate?

JayantaPoddar
MVP Esteemed Contributor

Hi Johan,

It should show the values without the "-" sign.

Make sure your system Regional Date setting is in same format. And CalculatedEndDate is in Long datatype.

Considering the due date is same for all records, any value more than the CalculatedEndDate is overdue.

Change the symbology accordingly.

Thanks,

Jay



Think Location
JohanLundgren
Occasional Contributor

Thanks Jay!

I can now see the new calculated value for date.

//Johan

0 Kudos
JoshWhite
Regular Contributor III

Jay,

How would you do it if the original date field is MM/DD/YYYY format?

Nevermind I did some tweaking and came up with

Int (Right( [Date], 4 ) & Left( [Date], 2 ) &Mid( [Date], 4, 2  )  )

So mine went from 01/01/2012 to 20120101

JayantaPoddar
MVP Esteemed Contributor

You are right Josh...



Think Location
MuhammadFayaz
Occasional Contributor

Dear Jay,

What if my date format is DD/MM/YY ?

0 Kudos