Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with admission periods (see attachment).
The [Admission period current admission (days)] is the following dimension:
ProcessingTime
The [Admission period last admission (days)] is the following dimension:
ProcessingTimeLastAdmission
The [Total admission period (days)] is calculated as follows:
Max(ProcessingTime)
+
If(IsNull(Max(ProcessingTimeLastAdmission)),0,Max(ProcessingTimeLastAdmission))
The bar graph in the table is the [Total admission period] in days and is created as follows:
Repeat('▇'
,
Max(ProcessingTime)
+
If(IsNull(Max(ProcessingTimeLastAdmission)),0,Max(ProcessingTimeLastAdmission))
)
So far, so great! Now i want to give the cubes who are from the last admission period a different color. For example, if the admission period from the current admission is 4 days and the admission period from the last admission is 1 day, i want 1 red cube and 4 green cubes.
How do i do this?
Thanks in advance!
Would something like the following work?
=repeat('🟩', max(B)) & repeat('🟥', coalesce(max(C), 0))
Also, I think the coalesce function will work better for your if statement. It returns the first non-null argument.
Would something like the following work?
=repeat('🟩', max(B)) & repeat('🟥', coalesce(max(C), 0))
Also, I think the coalesce function will work better for your if statement. It returns the first non-null argument.
Hi, KGalloway,
The coalesce function works perfectly for the non-null values. I inserted your code in the [Expression] field. I guess that i also have to insert something in the [Expression text color] field to make the colors visible, right?
If so, what code did you insert here to make the difference between the red and the green color?
Thanks in advance!
I used =repeat('🟩', max(B)) & repeat('🟥', coalesce(max(C), 0)) in the [Expression] field. I did copy the green and red square characters from unicode sources I found through google. I didn't have to insert anything in the [Expression text color] field.
emoji's are your friends 🙂
Thanks!