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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average of Set Expression

Hello,

I am a beginner on Qlikview and i would like to do the Average of percentage of different AsOf (2 here) into a Pivot Table.

I tried the expression:

AVG({$< AsOf = {">=$(=Num(AddMonths(Max(STEAsOf),-2)))<=$(=Num(Date(STEAsOf, 'DD/MM/YYYY')))"}>} Sum(TOTAL <Job> STE)/SUM(TOTAL STE))

But it doesn't work 😕

Please find a sample attached here.

Thanks you in advance for your help,

Sébastien.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe this?

[It's a little confusing that you keep changing your AsOf field name]

Sum({$< AsOF = {">=$(=Num(AddMonths(Max(AsOF),-2)))<=$(=Num(Date(AsOF, 'DD/MM/YYYY')))"}>} Total<Job> STE)

/SUM({$< AsOF = {">=$(=Num(AddMonths(Max(AsOF),-2)))<=$(=Num(Date(AsOF, 'DD/MM/YYYY')))"}>} TOTAL STE)

edit: And just in case you wonder why I dismissed the avg() function:

Average – Which average?

View solution in original post

3 Replies
sunny_talwar

Is this the same question?

My bad, may be this:

Avg(Aggr(Sum(TOTAL <Job> STE)/SUM(TOTAL STE), Job))


Capture.PNG

swuehl
MVP
MVP

Maybe this?

[It's a little confusing that you keep changing your AsOf field name]

Sum({$< AsOF = {">=$(=Num(AddMonths(Max(AsOF),-2)))<=$(=Num(Date(AsOF, 'DD/MM/YYYY')))"}>} Total<Job> STE)

/SUM({$< AsOF = {">=$(=Num(AddMonths(Max(AsOF),-2)))<=$(=Num(Date(AsOF, 'DD/MM/YYYY')))"}>} TOTAL STE)

edit: And just in case you wonder why I dismissed the avg() function:

Average – Which average?

Anonymous
Not applicable
Author

Thanks a lot it works perfectly !