Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
limingthefirst
New 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

Tags (3)
1 Solution

Accepted Solutions
Highlighted

Re: Sum intersection

May be this

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

View solution in original post

18 Replies
Highlighted

Re: Sum intersection

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
limingthefirst
New Contributor III

Re: Sum intersection

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

Highlighted

Re: Sum intersection

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 ??

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
limingthefirst
New Contributor III

Re: Sum intersection

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

Highlighted

Re: Sum intersection

Can you attach your sample?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP
MVP

Re: Sum intersection

May be this:

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

Highlighted
limingthefirst
New Contributor III

Re: Sum intersection

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.

Highlighted
limingthefirst
New Contributor III

Re: Sum intersection

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

Highlighted

Re: Sum intersection

May be this?

=SUM({$<COUNTRY>}QTY)

OR

=SUM({1} QTY)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)