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: 
Applicable88
Creator III
Creator III

Aggregated functions sum another dimension only distinct

Hello,

I have a table like this :

 

SerialnumberTimestampPositionDeliverynumber
BF3333306.05.20201011111111
BF3333406.05.20201011111111
BF3333506.05.20201011111111
BF3333606.05.20202011111111
BF3333706.05.20202022222222
BF3333807.05.20203033333333
BF3333907.05.20203033333333
BF3334007.05.20203033333333
BF3334107.05.20203033333333
BF3334207.05.20203033333333

 

The Serialnumber is unique, a delivery can contain more than one serialnumber and a serialnumber can belongs always to a group of position. Also the date of the package can be on two different days.

I now just want to add a colllumn  with the   measure where I can see in each line how many Serialnumbers a specific delivery contains.  The date can be disregarded.

I used something like this:

=sum(aggr(count([Serialnumber]), [Deliverynumber], Position))

But since there are many positions, i only want to count each of the position distinct. 

And something like this doesn't work out: 

=sum(aggr(count([Serialnumber]), [Deliverynumber], distinct Position))

How can I only count this aggregation with the same Position distinct?

Thanks in advance.

Best. 

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi 

if you want to count it per Delivery and position , you can use : count(total<Deliverynumber,Position>Serialnumber)

if you want per delivery : count(total<Deliverynumber>Serialnumber)

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi 

if you want to count it per Delivery and position , you can use : count(total<Deliverynumber,Position>Serialnumber)

if you want per delivery : count(total<Deliverynumber>Serialnumber)

Sue_Macaluso
Community Manager
Community Manager

corrected. 

Sue Macaluso