Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis, get the relations of the selection without the selection

Hi everyone,

I know the title may look somewhat confuse but i will try to expain it the best i can now:

I have 2 fields that are related: worker and product line. Each worker only works in 1 product line but each product line has multiple workers [1,*]. There is a 3rd field, also related to both of them which is a metric to which i need to appy a count (it ends up in an expression as count([FIELD]).

The problem is that i need to represent at the same time the metric for workers and for product line. What i want is to select 1 worker and show his/her metric and, at the same time show the metric for the product line.

I also would rather prefer to not use islands (tho if there is no other way it is fine). As information I moreless achived this doing: =count({$< Product line=P(), Worker=>} FIELD)              But this seems to have no sense to me, does it?

Thanks for your time and help.

Regards,

Lluís

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Consider two list boxes with product line and worker.

If you select a worker, this worker should be green / selected (and all other grey) while the related product line should get white / possible, while the other unrelated lines get grey. Right?

Now, what your set analysis is saying:

a) Make a selection (only in the context of the aggregation) in field product line for the possible / white values

b) clear the active user selection in field worker

This should lead to (only in the context of the aggregation)

a) a selection in field product line

b) no selection in worker field, all related workers are possible

I guess that's what you want if you say 'at the same time show the metric for the product line'.

I might miss something, because you haven't told us much about your the context of your measures (chart / dimensions).

I haven't fully understood 'A senior coworker told me that this was incorrect becose the expression P() needed to take some values, is not allways true then i guess?' can you or your co-worker give some sample?


You don't need to pass any arguments to p() function, but you can. Have a look at the HELP for full syntax.

View solution in original post

6 Replies
swuehl
MVP
MVP

=count({$< Product line=P(), Worker=>} FIELD) 


That's what I would had proposed, too. What's your concern?

Anonymous
Not applicable
Author

Product line=P() means that qlik is taking the values related to the worker selected?

A senior coworker told me that this was incorrect becose the expression P() needed to take some values, is not allways true then i guess?

Thanks for the help Stefan, i am reading a lot of threads where you helped

tresesco
MVP
MVP

To remove that confusion, you can always use:

=count({$< [Product line]=P([Product line]), Worker=>} FIELD)

swuehl
MVP
MVP

Consider two list boxes with product line and worker.

If you select a worker, this worker should be green / selected (and all other grey) while the related product line should get white / possible, while the other unrelated lines get grey. Right?

Now, what your set analysis is saying:

a) Make a selection (only in the context of the aggregation) in field product line for the possible / white values

b) clear the active user selection in field worker

This should lead to (only in the context of the aggregation)

a) a selection in field product line

b) no selection in worker field, all related workers are possible

I guess that's what you want if you say 'at the same time show the metric for the product line'.

I might miss something, because you haven't told us much about your the context of your measures (chart / dimensions).

I haven't fully understood 'A senior coworker told me that this was incorrect becose the expression P() needed to take some values, is not allways true then i guess?' can you or your co-worker give some sample?


You don't need to pass any arguments to p() function, but you can. Have a look at the HELP for full syntax.

Anonymous
Not applicable
Author

This was it!! You made it clear


Thanks for the explanation!

Regarards

Anonymous
Not applicable
Author

Nice idea. I am just starting with qlik so i am somehow confused .

Thank you for the help!