Qlik Community

Ask a Question

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

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

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))

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)