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

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

If this resolves your Query please like and accept this as an answer.
ZoeM
Specialist
Specialist
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)?