Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Dynamic category based on selection

Hi,

Is it possible to create dynamic category base on user selections?

Capture.PNG

In above example,  I have hard coded "Other" category for Products D,E,F

But my requirement is - For example:

If user selects Product A, B then rest of the possible products should come under category "Other"

If user selects A, D, C then rest of the possible products should come under "Other"

 

Kindly help! 

@sunny_talwar @swuehl   @Gysbert_Wassenaar @tresesco 

 

Thanks

 

1 Solution

Accepted Solutions
Highlighted

Here is another option

Create an inline table like this

Dim:
LOAD * INLINE [
    Dim
    1
    2
    3
];

and then this

Dimensions

=Pick(Dim, 'Revenue','Income','Expense')
=Aggr(If(Product = Only({1} Product), Product, 'Others'), Product)

Expression

Pick(Only(TOTAL <Dim> {1} Dim),
  Sum({<Product>}Revenue),
  Sum({<Product>}Income),
  Sum({<Product>}Expense)
)

View solution in original post

4 Replies
Highlighted
Master II
Master II

see attached qvw

hope this helps

Highlighted
MVP
MVP

Calculated dimension:

Aggr({<Product>} Only({<Product>}If( Index(GetFieldSelections(Product, '|'),Product) Or Len(GetFieldSelections(Product))=0,Product, 'Others')),Product)

Expression:

sum({<Product>}Revenue)

Highlighted

Here is another option

Create an inline table like this

Dim:
LOAD * INLINE [
    Dim
    1
    2
    3
];

and then this

Dimensions

=Pick(Dim, 'Revenue','Income','Expense')
=Aggr(If(Product = Only({1} Product), Product, 'Others'), Product)

Expression

Pick(Only(TOTAL <Dim> {1} Dim),
  Sum({<Product>}Revenue),
  Sum({<Product>}Income),
  Sum({<Product>}Expense)
)

View solution in original post

Highlighted
Creator
Creator

Thanks Frank, Tresesco, Sunny