Qlik Community

Qlik Design Blog

All about product and Qlik solutions: scripting, data modeling, visual design, extensions, best practices, etc.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
Employee
Employee

In Qlik Sense, alternate dimensions and measures are available providing users the option to change the dimensions and/or measures being used in a chart.  Alternate dimensions and measures are defined in advance and provide users with different views of the data all in one chart.  Alternate dimensions and measures can be added to a visualization in the Properties panel.  In the image below, there is a bar chart with Product Sub Group as the dimension and Sales $ as the measure.  There are also two Alternative dimensions: Product Group and Product.  Alternate dimensions and measures can be added by clicking the Add alternative button and selecting or entering the new dimension or measure.

bar chart.png

By default, the bar chart above shows the Sales $ by the main dimension for the chart, Product Sub Group.  Since there are alternative dimensions set up, the user can also view the Sales $ by Product Group or Product by simply clicking the arrow next to the dimension name on the y-axis and selecting either Product Group or Product.

dimension switch.png

In Qlik Sense 3.0, the ability to change the dimension from the axis was added.  Users can also change the dimension or measure by opening the Exploration Menu and changing the dimension or measure.

dimension switch panel.png

Adding alternate measures is just as easy.  In the image below, two alternate measures were added to the Margin Amount Over Time line chart: Sales $ and Budget $.

line chart.png

A few things to be aware of when using alternate dimensions and measures:

  • In bar, line and combo charts, the title needs to be visible on the axis of the alternate dimension/measure so the user can see the arrow to click on to change the dimension/measure.  If you prefer not to show the title, then the user can still change the dimension/measure by going into the Exploration Menu.
  • Alternate dimensions and measures can be added to all chart types but they can only be changed in the visualization (via the axis) in bar, line and combo charts.  In other chart, they can be changed in the Exploration Menu.

If you are familiar with QlikView, you may find alternate dimensions and measures to be similar to the cyclic group that is available in QlikView.  They are both great features because it allows the user to have one visualization with numerous views.  This is ideal in keeping your sheets uncluttered.  Instead of having the same visualization repeated using different dimensions or measures, you can now have one chart with alternate dimensions and/or measures.

Thanks,

Jennell

13 Comments
Creator
Creator

Chris,

I don't think there is a way to reference the dimension being used at this time.  However, you can modify the sort order depending on the dimension.  For each alternate dimension you have to first make it the primary dimension, change the sort order for it, and then drag it back down to be an alternate.  The new sort order will 'stick' when you do this.

I don't think there is a way to change the calculation based on the dimension selected.

Best,

Sarah

0 Likes
6,245 Views
Creator
Creator

Hello Jennell,

Thank you for this post.

I was not aware that Qlik Sense had a "drop down" menu but not I am. Brilliant.

My graphs were being shown as Label only, but when this is changed under Appearance / X Axis to Labels and Title, hey presto, the drop down menu appears saving the need to open the Exploration Menu.

An instant new view.

Best Regards,

Colin

0 Likes
6,245 Views

Is there a GetCurrentField() equivalent to determine the alternate dimension?

6,245 Views
Partner
Partner
0 Likes
6,245 Views
Contributor III
Contributor III

Quick question,

I have a line chart

I have a 2 dimensions and 1 measure.

Dim1 and Dim2.

There are 3 alternate dimensions assume, AltDim1, AltDim2, AltDim3.

Right now in the Drop down to switch dimensions, the Alternate dimensions appear under both Dim1 and Dim2 drop down.

Is there a wake to force that the Alt Dimensions should be appearing (basically switching) on only one of the 2 actual dimensions.

Best,

Priyash

0 Likes
6,245 Views
Partner
Partner

SOLUTION: Dynamic referencing of selected Alternate Dimension in expressions, color coding and more.

chrisweldon

stalwar1

sarahplymale

Yes, you can reference the selected Alternate Dimension via the function GetObjectField(<index>) where index = position of your dimension starting at zero.

E.g. Assuming you have two dimensions Group1 and Group2 set up as a main and an alternative dimension you can write expressions such as:

if(GetObjectField(0)='Group1',do something,do something else)

Which means that you can for example custom colour your bar chart with an Alternate Dimension by using the 'Colour by Expression' option and write formula such as:

=pick(match(GetObjectField(0),'Group1','Group2')

, // If Group1 is the active dimension, set the colour to Yellow for all bars where the value of Group1 = 'Bottom'

if(Group1='Bottom',Yellow(),Green())

, // If Group2 is the active dimension, set the colour to lightGray for all bars

lightgray()

)

Limitations:

The GetObjectField function cannot be used in a 'title' field.

Other observations:

The Alternate Dimension feature seems incomplete in its released feature set. Being able to reference key properties, such as the active dimension across an object is pretty fundamental. I can't see an obvious reason why GetObjectField should not be executable from within a title as the title is arguably part of the object, jmc I would definitely pass that one back to Product Development as a recommendation to address in a future release, so that Alternate Dimensions can deliver closer to par with the QlikView Cycle Group feature.


Best regards

Jonas

6,245 Views