Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count per unique record

Another question:  I have two tables with a one to many relationship.  I want a count from the table where there is only one record and a sum on the table with many records.  How do I do that? 

1 Reply
Sokkorn
Master
Master

Hi,

Suppose that you have two table below

1. Invoice header:

InvCustomer
1A
2B
3C

2. Invoice details

InvItemAmount
1I00110
1I00220
1I00330
2I00140
2I00250

So you link both table via [Invoice header],[Inv]=[Invoice details].[Inv]

From this we will got one to many relationship.

Now try to create Straight table with

     1. Dimension: Inv and Customer

     2. Expression

          a. Count(Inv)

          b. Sum(Amount)

It should give you

InvCustomerCount(Inv)Sum(Amount)
1A160
2B190
3C10

Regards,

Sokkorn