Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to count up multiple values across several different fields:
User | Colour A | Colour B | Colour C | Colour D |
James | GREEN | BLUE | - | GREEN |
Charlotte | BLUE | GREEN | BLUE | - |
Neil | YELLOW | YELLOW | YELLOW | BLUE |
Lauren | GREEN | BLUE | - | YELLOW |
Sarah | YELLOW | YELLOW | YELLOW | - |
I need to see how often each value is used, so that the values become the dimensions:
YELLOW | 7 |
GREEN | 4 |
BLUE | 5 |
I also need to be able to filter at User level, so filtering on James would show
YELLOW | - |
GREEN | 2 |
BLUE | 1 |
I hope this makes sense, thanks!!
Flatten the table in backend. Something like:
new_table:
load User, [Colour A] as Colour resident old_table where len([Colour A])>0;
concatenate load User, [Colour B] as Colour resident old_table where len([Colour B])>0;
concatenate load User, [Colour C] as Colour resident old_table where len([Colour C])>0;
concatenate load User, [Colour D] as Colour resident old_table where len([Colour D])>0;
From this new table you can count colours per User.