Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
annabergendal
Partner - Creator
Partner - Creator

Current selection but include all for one field in Set Analysis

Hi,

I feel quite stupid, I am sure this is piece of cake...

I have a straight table where I want average sum of sales for each supplier.

So for supplier A it should say 0,14 (100/700), supplier B 0,29 (200/700) etc...

How should I write my set analysis expression if I want current selection (in the real app I want selections to be included, except for the field supplier where it should calculate on all)


Thanks

1 Solution

Accepted Solutions
mdmukramali
Specialist III
Specialist III

Dear,

Can you try below expression:

=Sum(Sales)/Sum(TOTAL{<Supplier=>} Sales)

and don't select relative option .

select Show in Percent from Number  Tab.

View solution in original post

10 Replies
tresesco
MVP
MVP

Avg(Sales) ?

morganaaron
Specialist
Specialist

Sum(Sales) / Sum (Total Sales) will give you their relative % of the overall total. You could also use Sum(Sales) and tick the relative checkbox next to it.

mdmukramali
Specialist III
Specialist III

Dear,

=Sum(Sales)/Sum(TOTAL Sales)

annabergendal
Partner - Creator
Partner - Creator
Author

I use relative button and that's perfect, if no selection has been made on supplier. But if I select supplier A, I would still like it to count the relation of ALL suppliers...

mdmukramali
Specialist III
Specialist III

Dear,

Can you try below expression:

=Sum(Sales)/Sum(TOTAL{<Supplier=>} Sales)

and don't select relative option .

select Show in Percent from Number  Tab.

tresesco
MVP
MVP

In that case try:

Sum(Sales) / Sum ( ALL Sales)                  // if you want to ignore all other selections

PFA

Not applicable

First solution:

sum(Sales)

/

sum(ALL Sales)

Equivalent sintax:

sum(Sales)/sum({1}TOTAL Sales)

Not applicable

Check the content 'set analysis' in Qlik guide contents for more details

Not applicable

Check directly to your file if you want