Skip to main content
Question

Color code calendar events based on divisor of Record ID #

  • August 14, 2019
  • 0 replies
  • 41 views

I have generated a calendar report and can color code the events on the calendar.

Currently I color code them based upon who the tech assigned to the event is. It is hard coded based on tech name.

However, I would like to somewhat automate this so that it is not based upon a text string (i.e. Tech's name) but based upon the Tech's record id #.

I need to do it based upon the tech id being wholly divisible.

The number of techs I have will vary, Soni don't want to continually be manually changing text strings to correctly color code a calendar event.

I was thinking of something like
if the tech id is wholly divisible by
5 then green
4 then blue
3 then yellow
2 then purple
1 then orange

I just can't figure out how to do the wholly divisible part ...

Any suggestions, ideas, etc??

I was thinking of using CASE, but wasn't sure on how to correctly implement the requirement of the tech id being wholly divisible.

I hope that makes sense.

-Andrew
This topic has been closed for replies.

  • Registered
  • August 23, 2019
The Mod function will return the remainder of x/y, so when Mod(x,y) = 0 then x is evenly divisible by y. If you combine If and Mod, you could get the coloring down. Here's an example based on the exact situation presented in your post:
If(Mod( [Related Tech], 5 ) = 0, "green", Mod( [Related Tech], 4 ) = 0, "blue", Mod( [Related Tech], 3 ) = 0,"yellow", Mod( [Related Tech], 2 ) = 0, "purple", "orange")​

Hope this helps.

-Tom

------------------------------
Tom M
------------------------------