Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Put a condition on a dimension

I have created a pivot table that contains the following dimensions:

Division, Item, and Measure.

The other items are expressions that contain calculations based on what the user inputs for the year & quarter.

My dilemma is that I don't want items to appear if the shipment quantity for that item is 0.  For instance, if the '2014 Q1 Data' column has 0 for the item then I don't want the item to appear at all.

Here's what the chart looks like:

I have tried the enable conditional on the item dimension but it's not working.  Any other suggestions????

Here is what I put in the enable conditional:

=sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)},Measure={'Shipment Qty'}>}(Value))<>0

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Or you can try to replace Item dimension with calculated dimension (and label it Item):

aggr(if(sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)},Measure={'Shipment Qty'}>}(Value))<>0,Item),Item)

As always with calculated dimensions - don't forget to check "Suppress when Value is Null"

View solution in original post

5 Replies
sunny_talwar

For each of your other expressions (except 2014 Q1 Data) you can use the following if condition:

=If([2014 Q1 Data] > 0, yourExpression)

Here [2014 Q1 Data] should match the exact label for the expression you want to use (hint: [2014 Q1 Data] will turn blue when it exactly matches the label)

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Or you can try to replace Item dimension with calculated dimension (and label it Item):

aggr(if(sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)},Measure={'Shipment Qty'}>}(Value))<>0,Item),Item)

As always with calculated dimensions - don't forget to check "Suppress when Value is Null"

Not applicable
Author

when I do the calculated dimension, it won't give any items at all

Anonymous
Not applicable
Author

I would create a flag (1 or null) in the script at item, fiscal year, qtr (lowest level) based on whether shipment qty is 0 or not and use it in the calculated dimesion for item

Anonymous
Not applicable
Author

Why not?  Can you upload an example?