Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a table like this , ColA,ColB, ColC would only be one of Apple, Banana, orange.
ID,ColA, ColB, ColC
1,apple,banana,orange
2, banana,apple,orange
3, orange,banana,apple
4,.............
So how do I create a one dimension bar chart that count through apple ,banana, orange for all three columns ?
Thanks everyone.
I think the best solution would be to change the actual data model by unpivoting your data so that ColA, ColB, ColC are just one column.
See the link below for a guide to unpivoting in the data manager:
Or if you'd prefer to do it in the load script you can use the Crosstable prefix:
I would modify the data itself to be something like:
ID | ColumnType | Value | Counter |
1 | A | apple | 1 |
1 | B | banana | 1 |
1 | C | orange | 1 |
2 | A | banana | 1 |
2 | B | apple | 1 |
2 | C | orange | 1 |
3 | A | orange | 1 |
3 | B | banana | 1 |
3 | C | apple | 1 |
Then have your dimension be Value and your expression be:
Sum(Counter)
. This would be performant and also give you the flexibility to only show one column type if needed using:
Sum({<ColumnType={'A'}>} Counter)