Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
khaycock
Creator
Creator

Calculation condition in a pivot table

I really need to restrict a pivot table to only show data from a specific data set.

I have tired using this expression in the Calculation Condition box but it isn't restricting.

=if(Type='Non-Blue Box',1,0)

When I select the option myself manually through a list box, it does restrict.

Any ideas?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Check attached qvw.

I have included set analysis section {<Type={'Non-Blue Box'}>} in all aggregation functions you used both in variables and direct expressions.

Capture.PNG

View solution in original post

11 Replies
Anil_Babu_Samineni

May be try this?

Pick(Match(Type, 'Non-Blue Box'),1,0)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

I assume that Type is a field that has more than one possible value. [Type] will evaluate to null unless you restrict it to one possible value. To see if 'Non-Blue Box' is a possible value for Type, you can do something like

=Index(Concat(Type, ','), 'Non-Blue Box') > 0

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
khaycock
Creator
Creator
Author

No change

Anil_Babu_Samineni

Can you share sample data and tell us where you are doing and what you indeed

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
khaycock
Creator
Creator
Author

It actually is one value as I created the field in the script to only restrict this table. I tried this statement anyway and still was no change

jonathandienst
Partner - Champion III
Partner - Champion III

Then I don't fully understand your environment. If Type a field or value? Does it have a single possible value? The more information you provide, the more accurate will be the answers.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
khaycock
Creator
Creator
Author

Here is a sample. Only week 8 data should be shown as that is the only Non-Blue Box data I have.

Thanks

khaycock
Creator
Creator
Author

I have attached a sample file above which may be of help

vinieme12
Champion III
Champion III

You need to restrict the data in Set Analysis or using Calculated Dimension

Example using Set Analysis of the Expressions

SUM({<type={'Non-Blue Box'}>}   SALES)

Example using calculated dimensions

AGGR(if(type='Non-Blue Box',Fieldname),Fieldname)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.