Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ZoeM
Creator III
Creator III

Average and Set Analysis Expression

Hi Community.

I have an issue with incorporating the Average calculation within set analysis.

I have a Dimension called # of Days After Invoice and I need to calculate the average days > 14 days. In the below expression, I am counting the number of sales I have that meet the requirement:

=Count({$<[#of Days After Invoice]={'>14'},Sales,[Date Type]={'VPP Dates'},[Reference_Only]=-{'Yes'}>}[Sales])

I want to create a KPI in a text box that shows the average number of days and I cannot for the life of me figure out how to show this.

Any help rendered is truly appreciated. 

Labels (3)
3 Replies
sunny_talwar

Not really clear what you have, but may be try this

=Avg({$<[#of Days After Invoice] = {'>14'},Sales,[Date Type] = {'VPP Dates'}, [Reference_Only]=-{'Yes'}>} [#of Days After Invoice])
Somasundaram
Creator III
Creator III

May be like this,

=Count({$<[#of Days After Invoice]={">14"},[Date Type]={'VPP Dates'},[Reference_Only]-={'Yes'}>}[Sales])


-Somasundaram
ZoeM
Creator III
Creator III
Author

That did not work Sunny, somehow I am getting a larger number than I would in Excel when I export the data file. Do I have to aggregate it (aggr)?