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"
MCFNeil
8 years agoQrew Captain
Now 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.
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.