Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ivanyang25
Contributor III
Contributor III

How to put color (with expression) in drill down dimension?

Dear Qlik Sense Experts

I am new to Qlik Sense and I am a front end user

I have created a drill down dimension as below which I group ‘Product’ into 3 types: ‘A’, ‘B’, ‘C’


1.PNG

I already put color with expression for A1/A2/A3/A4/B1/B2/B3/B4/C. But how can I put color for A & B as well?

I want to put color for the upper layout (A/B/C) and lower layout (A1/A2/A3/A4/B1/B2/B3/B4/C) at the same time so that user can see color before or after they drill down on this pie

Is it possible to do so in Qlik Sense? If so, how to make it happen?

Thank you for your advice in advance

2.PNG


14 Replies
ivanyang25
Contributor III
Contributor III
Author

Dear Ruben

Thank you so much for the feedback and I am so sorry to bother you again

My client has made his request more specific.

Now he groups 'NewRelease' / 'Aged NoPSD' / 'M1M2 Make' / 'M1M2 Fail' into 'No PSD'

Groups 'OverAllFail M3' / 'OverAllFail M1M2' into 'OverAllFail'

Keep 'Overall Make' as 'Overall Make'

In this way, can we still use Minstring in this case? I try it but it doesn't work

Do you have any idea base on this new request?

You could refer to the attached raw data and qvf file for your reference

1.PNG

2.PNG

Ivan

rubenmarin

Hi Ivan, still can be done as:

if (Product='NewRelease',RGB (106,191,74),

if (Product='Aged NoPSD',RGB (226,35,26),

if (Product='M1M2 Make',RGB (255,106,0),

if (Product='M1M2 Fail',RGB (62,141,221),

if (Product='OverAllFail M3',RGB (233,107,175),

if (Product='OverAllFail M1M2',RGB (111,113,112),

if (Product='Overall Make',RGB (74,192,224),

if (Match(MinString(Product), 'Aged NoPSD', 'NewRelease', 'M1M2 Make', 'M1M2 Fail'), blue(),

if (Match(MinString(Product)='OverAllFail M1M2', 'OverAllFail M3'), yellow()

)))))))))

Another option can be to create a new field in script called [Product Group] (or similar), so the hierarchy has two levels: [Product Group] and [Product]. Then you have real values to select and apply colors using the real values for each level.

ivanyang25
Contributor III
Contributor III
Author

Ruben

It works! I can't express how much I appreciate your patience and help!

By the way, may I know how to create a new field in script called [Product Group] ?


Do I have to do it at back-end side?

Ivan

rubenmarin

Hi Ivan, yes, it's done in the back-end; can be done using Script Editor or Data Manager.

Using Data Manager, viewing as 'Tables', edit the table, you have a button called 'Add fields', with an option to add a 'calculated field'

Anonymous
Not applicable

Hi,

The simple way I found on this drilldown - coloring is,

writing IF() statement in a order of your last dimensions to be written first followed by subsequent dependent dimensions.Ex:

A -> B,C and  C -> D,E,F then you should write an expression as;

If(Product='D',rgb(),

If(Product='E',rgb(),

If(Product='F',rgb(),

If(Product='B',rgb(),

If(Product='C',rgb(),

If(Product='A',rgb()))))))

Hope this helps.

Reg,

Mrutyunjaya