Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Calculation

Hi All,

I have two tables

Table1:

Stages

Division

S1

2

S2

3

Table 2:
This table has field called DocID in the table itself. Using Filebasename function I have taken the field Stages. So totally I have two excel sheets one with S1 and another with S2. Here Stages is the Key field.

I am taking the count(DocID)

So In S1 - Count(DocID) is 100

In S2 - Count(DocID) is 200

My question.

If I select S1- qlikview should calculate 100*2

If I select S2 - qlikview should calculate 200*3

If I select S1&S2 - it should give 200+600 = 800

I have tried =count(if(Stages=Stages, DocID))*sum(if(Stages=Stages, Division))

But when I select S1&S2 its giving (100+200) *(3+2) = 1500

Please let me me if anyone needs further clarification. Seems to be simple, but there lying a trick.

Please what to do to get the required answer. Thanks in advance.

1 Reply
suniljain
Master
Master

Dear Ranjit,

Try to implement this scenario at script level it will reduce complexity.

and I think you can easily implement at design level.