Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Drill down dimension sorting/color grouping

I have a chart that show amount as y-axis and month as x-axis. I made a drill down dimension that has 1) month 2) stage so that once a user clicks on a month, it will show all the projects by stage of that month.

I originally had the first chart view to show projects grouped by month and colored by stages and now after the drill down dimension, it shows only one color (not a stacked bar chart anymore). Is it possible to maintained the stacked bar chart with drill down dimension?

Also, once you are in the second view of all the projects grouped by stages, I want to be able to distinguish different projects within the bar chart. How could these be achieved?

Thank you

1 Solution

Accepted Solutions
ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

1. always give your variables a identifier to help your code so I would call your AmountView variable vAmountView

If you choose to do this make sure you change the name in every place you reference it or you will get errors.

2. SET vAmountView=1;  just makes sure you have a default view for your charts on open.

3. Assuming your fields are called Month and Stage replace your dimension with

Pick(Match($(vAmountView),1,2),Month,Stage) for Dimension 1

Pick(Match($(vAmountView),1,2),Stage,Month) for Dimension 2

Its the <> brackets you don't need I just used them to denote it was a field/varaiable value not text.

Regards

Andy

8 Replies
ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

My guess would be the color setting in your first view color is set on expression which is no longer valid when you move to your second drilled down view.

A‌s a different approach which would achieve your objective try creating a cyclic group by using the qsvariable extension and setting a variable to allow the user to set the view they want to see.  I've written a document and sample app showing how you can get this going.   Then you can have multiple views in the same chart space.  

HOpe this helps

REgards

ANdy

ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

here's the link to the document I meantioned.

Makes Sense to go round in circles

Not applicable

Re: Drill down dimension sorting/color grouping

Hi Andy,

Thanks for your your help. I'm stuck in the 'How to apply your cyclic group in a chart?' section.

Where should I put

Pick(Match($(<Your Variable name>),1,2,3),<Your Dim1>,<Your Dim2>,<Your Dim3>)?

I have two dimensions (month and stage) under the data of the chart im working on.

ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

‌in your case you have 2 views by month which you can assign the value 1 and by stage you canassign the value 2 so the expression you have above would go in as your Chart dimension and dim1 would be replaced with month and dim2 with stage you can remove reference to 3 and dim 3.

YOu can use the same expression to create a dynamic title to.

Not applicable

Re: Drill down dimension sorting/color grouping

Hi Andy,

I have two buttons: Month and Stage and the title seems to work. So when I click on Month, it shows the title chart as 'Amount by Stage' and when I click on Stage, it shows 'Amount by Stage'.

However, it doesn't apply to the chart itself; the chart stays static. Your document shows dimension as Variable Chocies but on mine, I have both dimensions 'month' and 'stage'. How do I make them into one dimension or where should I exactly put the following?

     Pick(Match($(<AmountView>),1,2),<Month>,<Stage>)

Thank you for the help!

ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

Replace both your dimensions with

Dimension1

Pick(Match($(<AmountView>),1,2),<Month>,<Stage>)

Dimension2

Pick(Match($(<AmountView>),1,2),<Stage>,<Month>)

That way If you select Month your Primary Dimension will be Month and Secondary dimension Stage and visa versa.

Hope this helps

Regards

Andy

Not applicable

Re: Drill down dimension sorting/color grouping

I get an 'invalid dimension' if I do that.

Also, I put only 'SET AmountView=1;' in the data load editor.. ?

ogster1974
Honored Contributor II

Re: Drill down dimension sorting/color grouping

1. always give your variables a identifier to help your code so I would call your AmountView variable vAmountView

If you choose to do this make sure you change the name in every place you reference it or you will get errors.

2. SET vAmountView=1;  just makes sure you have a default view for your charts on open.

3. Assuming your fields are called Month and Stage replace your dimension with

Pick(Match($(vAmountView),1,2),Month,Stage) for Dimension 1

Pick(Match($(vAmountView),1,2),Stage,Month) for Dimension 2

Its the <> brackets you don't need I just used them to denote it was a field/varaiable value not text.

Regards

Andy