Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

calculate average for values > 0

Hi experts

This formula works fine:

avg( ([Entry Date (CPUDT)] - [Posting date]))

This formula not:

avg( ([Entry Date (CPUDT)] - [Posting date])-={'0'})

Any ideas how to solve this issue?

Thank you, Tom

Labels (4)
1 Solution

Accepted Solutions
MarcoWedel

maybe like 

Avg(If([Entry Date (CPUDT)]<>[Posting date],[Entry Date (CPUDT)] - [Posting date]))

or using some key field and set expression instead of the If() function:

Avg({$<Key={"=[Entry Date (CPUDT)]<>[Posting date]"}>} [Entry Date (CPUDT)] - [Posting date])

View solution in original post

1 Reply
MarcoWedel

maybe like 

Avg(If([Entry Date (CPUDT)]<>[Posting date],[Entry Date (CPUDT)] - [Posting date]))

or using some key field and set expression instead of the If() function:

Avg({$<Key={"=[Entry Date (CPUDT)]<>[Posting date]"}>} [Entry Date (CPUDT)] - [Posting date])