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: 
limingthefirst
Contributor III
Contributor III

Sum intersection

Hi everyone,

I have a trouble to sum intersection and union value.

For example:

Red color is attributes for S1, then I need to sum each A and C value,

sum(A) should be 6

sum(C) should be 24

111.png

When I select null of F4, I need each value of sum(F1)

This logic is in one sheet of report, and 2 hundred million data in fact qvd.

I've tried to group by this in script, but it is too slow and has linkage issue in report when I select other dimensions

The value maybe calculated in text object and bar chart and so on.

Can anybody give me some suggestions to me?

Thanks all.

The requirement is changed...

Add sample here

1 Solution

Accepted Solutions
sunny_talwar

May be this

=Count({<VENDOR=p(VENDOR),VENDOR={"=Count(DISTINCT {<COUNTRY>} COUNTRY)>1"}>}DISTINCT VENDOR)

View solution in original post

18 Replies
Anil_Babu_Samineni

May be use Aggregation like When should the Aggr() function NOT be used?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
limingthefirst
Contributor III
Contributor III
Author

Hi Anil,

Thanks for your link,

I've tried it =SUM(TOTAL <F1> F3)

but it is not what I want when select S1:

333.png

444.png

Anil_Babu_Samineni

You mean, You want to compare row level like S1 having C which has common to all. So, You need to pick 7+8+9 ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
limingthefirst
Contributor III
Contributor III
Author

Yes, sum(C)=7+8+9, sum(A)=1+2+3

Anil_Babu_Samineni

Can you attach your sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

May be this:

=SUM(TOTAL <F1> {1} F3)* Avg(1)

limingthefirst
Contributor III
Contributor III
Author

I like your answer, It's working, but there is an issue is that when I select S1 and the total result is 45 not 30.

limingthefirst
Contributor III
Contributor III
Author

Hi Anil, I've upload demo.qvw for you, and the requirement is changed, the comment is added in qvw file. thanks.

Anil_Babu_Samineni

May be this?

=SUM({$<COUNTRY>}QTY)

OR

=SUM({1} QTY)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful