Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
No problem,
Just enable the checkbox for Color-code events using a formula and use this formula (or a best practice in fact would be to make this as a formula-test field and then use the formula field itself as the formula for the Color calendar).
This will randomize across 20 colors based on the last 2 digits of the [Record ID#]
var number LastTwo = ToNumber(Right(ToText(Rem([Record ID#],20)),2));
Case($LastTwo,
1, "e6194b", // red
2, "3cb44b", // green
3, "ffe119", // yellow
4, "0082c8", //blue
5, "f58231", //Orange
6, "911eb4", //purple
7, "46f0f0", // Cyan
8, "f032e6", // maganta
9, "d2f53c", //lime
10, "fabebe", //pink
11, "008080", // teal
12, "e6beff", // lavender
13, "aa6e28", // brown
14, "fffac8", // beige
15, "800000", // maroon
16, "aaffc3", // mint
17, "808000", //olive
18, "ffd8b1", //coral
19, "000080", // navy
20, "808080") //grey"
Just enable the checkbox for Color-code events using a formula and use this formula (or a best practice in fact would be to make this as a formula-test field and then use the formula field itself as the formula for the Color calendar).
This will randomize across 20 colors based on the last 2 digits of the [Record ID#]
var number LastTwo = ToNumber(Right(ToText(Rem([Record ID#],20)),2));
Case($LastTwo,
1, "e6194b", // red
2, "3cb44b", // green
3, "ffe119", // yellow
4, "0082c8", //blue
5, "f58231", //Orange
6, "911eb4", //purple
7, "46f0f0", // Cyan
8, "f032e6", // maganta
9, "d2f53c", //lime
10, "fabebe", //pink
11, "008080", // teal
12, "e6beff", // lavender
13, "aa6e28", // brown
14, "fffac8", // beige
15, "800000", // maroon
16, "aaffc3", // mint
17, "808000", //olive
18, "ffd8b1", //coral
19, "000080", // navy
20, "808080") //grey"
- MCFNeil8 years agoQrew CaptainWho ever wants to "randomize" the colors of a calendar?
I've honestly never seen that... In any system. - QuickBaseCoachD8 years agoQrew CaptainMy client is using the Colour calendar to schedule multi day jobs. They they last for say 10 or 20 days. But when the job name extends across the week it is grey on a white background and is unlabeled, ie if the job starts on a Monday the job name is not repeated each day. So its not so easy to see how "long" a job is.
His real goal is to look at the "shop" wiht the month view and not have overlapping jobs. The shop can only do one job at a time. (These are really big jobs - steel fabrication for a building frame.).
So he is iteratively scheduling the Jobs and wants to easily see conflicts with multiple jobs on the same day. So if there are two colored bars on the same day, then he has a scheduling conflict. - MCFNeil8 years agoQrew CaptainNow that is an actual use case, but randomized based on Record ID# is no bueno.
So for that solution I'd recommend having the color hex on the table that controls the color. i.e. if you are basing it on "Shop" put the color hex on the "shop" table. Then pass the value as a lookup field.
Then your colorization formula on the report goes from 20 lines to one field
[Shop - Color Hex]
no if's or case's, it just pull the value direct.
Now you have consistent colorization that actually means something to the user. - QuickBaseCoachD8 years agoQrew CaptainThe entries into the table are actually the Jobs going though the shop. There is only 1 Fabrication Department which they call the Structure Steel Shop, "Shop" for short.
New jobs come in every day, big and small and some of them will need to be scheduled through the "Shop". Not all Jobs need to go through the Shop.