Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tomhovens
Contributor II
Contributor II

Need some help with Set Analysis

Hi All,

I'm trying to create a function to calculate an average of 461nm VIS based on specific values.

Rangnr is the rank per record 1,2,3 etc.

2880 is an solid number but the next number 4647 is a function avg(Rangnr)

avg({1<Rangnr={">2880<=4647"}>}461nmVis)

4647 is a dynamic number and will change based on the amount of data

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Avg({1<Rangnr={">2880<=$(=Avg(Rangnr))"}>}461nmVis)

View solution in original post

2 Replies
sunny_talwar

May be this:

Avg({1<Rangnr={">2880<=$(=Avg(Rangnr))"}>}461nmVis)

swuehl
MVP
MVP

To avoid a misinterpretation of a potentially returned floating point value from the avg(), use an additional Floor() function:

Avg({1<Rangnr={">2880<=$(=Floor(Avg(Rangnr)))"}>}461nmVis)

edit: Any you may want to also use set identifier 1 in the avg() function;

Avg({1<Rangnr={">2880<=$(=Floor(Avg({1} Rangnr)))"}>}461nmVis)