Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for
Did you mean:
Creator II

## Isolated restriction on chart expression

Hi all,

I need to user two different restriction from various field values in a single chart expression, but I want the one restriction should not affect another.

Eg : I have yearly sales of fruits which contains apple, orange, banana, grapes

In all fruits, i have six categories a,b,c,d,e,f vice versa for all the fruits.

 Fruit Category Apple a b c d e f g h Orange a b c d e f g h Banana a b c d e f g h Grapes a b c d e f g h

In the chart I Want show sales value of apple a,b category

Orange c,d

Banana e,f

Grapes h,i

But one restriction should not affect the other fruit sales value in the chart, I cannot play around with script editor or data modeling.

I want this to be get done on expression, Single or multiple

But in a single line chart.

Kindly help with this, Thanks in advance

1 Solution

Accepted Solutions
MVP

Try like:

if( Fruit='Apple', Sum({<Category={'a','b'}>}Sales),

if( Fruit='Orange', Sum({<Category={'c','d'}>}Sales),

if( Fruit='Grapes', Sum({<Category={'e','f'}>}Sales),

if( Fruit='Banana', Sum({<Category={'g','h'}>}Sales)))))

5 Replies
MVP

Taking this as input, what exactly do you expect to look your output like?

Creator II
Author

Hi Tresesco,

Thank you very much for the reply, This is just sample table

Each fruit contains the sales value over a period of year in every category.

i want line chart which shows all the fruits but the total value from specific category for each fruit in a expression.

Category Restriction for a single fruit should not be affecting others.

I hope i explained better, If not feel free to ask any questions

Thank you very much

MVP

Perhaps you have explained better. But I could not follow. Try to create a sample qvw with representative data and let know your expected output against that; suggesting a solution would be easier for me.

Creator II
Author

Hi Attached the sample data, I provided some requirements on that.

I hope it helps

MVP

Try like:

if( Fruit='Apple', Sum({<Category={'a','b'}>}Sales),

if( Fruit='Orange', Sum({<Category={'c','d'}>}Sales),

if( Fruit='Grapes', Sum({<Category={'e','f'}>}Sales),

if( Fruit='Banana', Sum({<Category={'g','h'}>}Sales)))))

Community Browser