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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
suzzymay
Contributor
Contributor

using sum distinct value in set analysis

Hi,

Trying to total up pool size for the most current date, but have duplicate records. 

eg

Date IP_pool Pool_size

20190915 1.120.0.0/20 4093

20190915 1.120.0.0/20 4093

 

Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}Pool_size)

This sums up all columns for date.

2 Solutions

Accepted Solutions
Vegar
MVP
MVP

I would suggest to try identifying the data you want to calculate by other means than their distinct values. 

To calculate distinct use this

 Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}distinct Pool_size)

 

You could also be helped by an only calculation.

Only({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}Pool_size)

View solution in original post

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

 

you could try with this expr:

 

Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}Aggr(Max(Pool_size),Date))

View solution in original post

4 Replies
Vegar
MVP
MVP

I would suggest to try identifying the data you want to calculate by other means than their distinct values. 

To calculate distinct use this

 Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}distinct Pool_size)

 

You could also be helped by an only calculation.

Only({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}Pool_size)

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

 

you could try with this expr:

 

Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>}Aggr(Max(Pool_size),Date))

sunny_talwar

I would try this

Sum({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>} Aggr(
    
    Only({<DynamicDateNum = {"$(=Max(DynamicDateNum))"}>} Pool_size)

, DynamicDateNum, IP_pool))

 

suzzymay
Contributor
Contributor
Author

Thankyou..