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: 
francis_gr
Creator
Creator

Exclude selection in expression

Hi!

In my attached file,  i have a expression (avg sales/pto) where i calculate the average sales for each position.

When i select a name, the value of the sales average for position (pto) is lost and match the person sales. I need that if i select a name, the average sales value for the position don`t change.

Thanks in advance

 

1 Solution

Accepted Solutions
sunny_talwar

Change your avg sales/pto expression to this

avg(total <pto> {<name>} sales) * avg(1)

View solution in original post

6 Replies
aworrall
Luminary Alumni
Luminary Alumni

Hi. You can use set analysis in a aggregate field and insert your field name and an equals sign to ignore any selection made in that field. Eg Sum({<[person name]=>}[Total Value]}
sunny_talwar

Change your avg sales/pto expression to this

avg(total <pto> {<name>} sales) * avg(1)
francis_gr
Creator
Creator
Author

Hi Sunny, thanks for your fast reply. That´s works fine.

I have one question

What exactly does avg(1)?

thanks for help

regards

sunny_talwar

Avg(1) will equal to 1 for selection and will equal to 0 for out of selection. So, when you select a name, Avg(1) = 1 for the specific name and becomes 0 for the others.  This is needed because we are ignoring selection in Name field for the expression so that the avg is calculated regardless of selection in name field. and then multiplying it with Avg(1) forces the expression to just show the name selected.

francis_gr
Creator
Creator
Author

Ok!

Thanks for the explanation.

 

francis_gr
Creator
Creator
Author

Hi Aworrall!

I really appreciate your interest in help!

Regards