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: 
ZoeM
Specialist
Specialist

Sum a field based on Distinct other field

Hello Community.

I need to find the Sum of one field after I find the Distinct Count of another field.  I have my Count Set Analysis as follows:

=Count({$<Stage={'Final'},[Date Type]={'VPP Dates'},Scale={'>50'},Track={'Y'},[#of Days Post VPP]={'>=0'}>}DISTINCT Program)

i.e. I am counting the distinct programs that meet this set of criteria. After counting them, I now need to find the sum of [#of Days Post VPP], how can I incorporate that into a Sum of Count expression?

 

any help rendered will be truly appreciated. 

Labels (4)
1 Reply
Anil_Babu_Samineni

Perhaps this?

=Sum({<[#of Days Post VPP]={'>=0'}>} Aggr(Count({$<Stage={'Final'},[Date Type]={'VPP Dates'},Scale={'>50'},Track={'Y'},[#of Days Post VPP]={'>=0'}>}DISTINCT Program), Dimension))

Or

=Sum({<[#of Days Post VPP]={'>=0'}, Stage={'Final'},[Date Type]={'VPP Dates'},Scale={'>50'},Track={'Y'}>} Aggr(Count({$<Stage={'Final'},[Date Type]={'VPP Dates'},Scale={'>50'},Track={'Y'},[#of Days Post VPP]={'>=0'}>}DISTINCT Program), Dimension))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)