0

I am having a problem with an unexpected brand appearing in my pivot table in qlik.

To give some background, my table shows Demand metrics for Oncology and Pharmaceutical brands. The order of Dimensions goes BUISNESS, BUISNESS UNIT, FRANCHISE, BRAND.

Recently someone added a new BUISNESS UNIT called OTHER that includes values for everything not Oncology or Pharma For a SALES table that I am not working on (I am working on DEMAND table). I do not need this new BUISNESS UNIT in my table but in the data model viewer it links to the data I need for demand through a common field. Changing the load editor or model viewer to make it unlink is not an option (dont ask why lol). When OTHER appears in my table it is filled with 0.0% values (since the measures are percentages).

MY QUESTION IS ...

Is there a way to write an expression that excludes a dimension (BUISNESS UNIT) when it is = to OTHER? I have tried messing around with dimension limitations specifying a relative value > 0.0% and / or exact value > 0 but nothing is working. I wish there was a componet called 'show row if' and I could set it to <> 'OTHER' but that is not a thing. Any suggestions?

I also apploigise as I cannot share any picutres as this is restriced data

1 Answer 1

1

If I'm understanding the issue correctly, you're basically just needing to filter this pivot table on a dimension value, which is straightforward enough.

Without access to the Data Load Editor or Data Manager, you have two options to achieve this:

Use the Filter option in the dashboard editor

This option is the easiest, but is limited to Qlik Cloud. If you're unsure about whether you're using Qlik Cloud, just look at your URL when you're logged in -- it should be something like YourCompany.us.qlikcloud.com.

To filter, just open your app, go into Edit mode, and then make sure that Advanced Mode is toggled off:

Screenshot of Qlik Cloud Advanced edit mode toggled off

Then, find the Filter option at the bottom-left part of the screen. Simply Add the BUSINESS UNIT dimension, choose the Other value, and then select the Exclude option. Done!

GIF screen recording of how to filter a chart in Qlik Cloud

Use a Set Expression

If you are not using Qlik Cloud and are, thus, using Qlik Sense Enterprise on Windows or Qlik Sense Desktop, you can use a Set Expression to achieve this.

TLDR

In your pivot table, replace your [BUSINESS UNIT] expression with this: =Aggr(Only({<[BUSINESS UNIT]-={'Other'}>} [BUSINESS UNIT]), [BUSINESS UNIT]). Then Uncheck the Include null values option.

Explanation

If you're not familiar with Set Analysis, it's basically a way to "build in" selections into a measure or chart. In practical terms, it's a way we can filter values. Set Analysis is meant only for measures ("aggregations"), but we can use a simple trick to use it on dimensions, too.

In your pivot table, replace your [BUSINESS UNIT] expression with this:

=Aggr(Only({<[BUSINESS UNIT]-={'Other'}>} [BUSINESS UNIT]), [BUSINESS UNIT])

A few things are going on here:

  • We are using the Only() function here because, like I mentioned above, we need to use a measure for Set Analysis to work. This function returns a value if as long as only one value is available.
  • Normally the above behavior wouldn't be helpful here because we have several Business Unit values we want to return, so we use the Aggr() function to group Only([BUSINESS UNIT]) by [BUSINESS UNIT] itself.
  • Finally, we add the actual Set Expression, {<[BUSINESS UNIT]-={'Other'}>}, which is basically saying "give me the set of [BUSINESS UNIT] values, excluding the value 'Other'". The exclusion operator is that minus sign before the equal sign.

The last step would be to uncheck the Include null values option for the [BUSINESS UNIT] field.

Screenshot of Qlik Sense pivot table after filtering

Sign up to request clarification or add additional context in comments.

1 Comment

samthecodegod, did this end up answering your question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.