Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mkliqvia
Partner - Contributor II
Partner - Contributor II

Set analysis on a dimension used for color coding

Hi all,

I have following data in my app, with both fields not related to each other:

customer.png

In the app, we have a filter on 'Customer status', which is always on value ACTV.

I have a bar chart which shows data on the 'Activity Type' (stacked bar chart with color coding in function of the 'Activity Type').

- When Customer status = ACTV is not selected, the colors for each 'Activity Type' work correctly.
- but when Customer status = ACTV is selected (default), the colors are not shown. So I try to find a way to make that dimension ignore the filter on Customer status.

I have tried multiple solutions to have the Color by Dimension ignore the filter on [Customer status], but they don't seem to work:

- aggr(only({<[Customer status]=>} [Activity Type]),[Activity Type])
- concat({<[Customer status]=>} distinct [Activity Type], ',')
- aggr(concat({<[Customer status]=>} distinct [Activity Type],','),[Activity Type])

Do you have any idea what other possible solutions I could try?

For info, with color coding set to 'Single Color', I can see the activity types stacks, but cannot color each of them (see image). While when no selection is made on the ACTV value, the colors are rendered well (one for each activity type). 
customer2.png

Labels (3)
14 Replies
JordyWegman
Partner - Master
Partner - Master

Hi,

Any possibility to share the QVF? This will make it easier to fix the problem.

Jordy

Climber

Work smarter, not harder
mkliqvia
Partner - Contributor II
Partner - Contributor II
Author

Hi,

There is confidential information in this QVF, so I cannot share it 😕

 

 

sunny_talwar

Are you using a color expression for color?

JordyWegman
Partner - Master
Partner - Master

Hi,

Try this:

- aggr({<[Customer status]=>}only({<[Customer status]=>} [Activity Type]),[Activity Type])
- concat({<[Customer status]=>} distinct [Activity Type], ',')
- aggr({<[Customer status]=>}concat({<[Customer status]=>} distinct [Activity Type],','),[Activity Type]

I think you need the set analysis also in the aggregation.

Jordy

Climber 

Work smarter, not harder
mkliqvia
Partner - Contributor II
Partner - Contributor II
Author

In the Colors and legend part of the bar chart, I use color 'By Dimension'. There I write the expression in the 'select dimension' box. 

sunny_talwar

Have not tried that before, but where do you specify the color for each dimension? It is determined on it's own? May be try this

only({<[Customer status]=>} [Activity Type])
mkliqvia
Partner - Contributor II
Partner - Contributor II
Author

Thanks, I tried the 3 of them (in the color 'By Dimension', pasting it in the dimension field, but it didn't work.

For info, with color coding set to 'Single Color', I can see the activity types stacks, but cannot color each of them (see image). While when no selection is made on the ACTV value, the colors are rendered well (one for each activity type). 

customer2.png

mkliqvia
Partner - Contributor II
Partner - Contributor II
Author

Thanks for the suggestion, but it didn't work.

Here's where I pasted the code:

customer3.png

sunny_talwar

Just out of curiosity, are you ignore selection in [Customer status] field within your expression or not?