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

Problem with rowno() and average

Hi all,

I have a problem to calculate the average with a rowno(), I have the following table:

id    Key     Value NumRow=rowno()

12      1        45      1

14      1        46      2

78      1        78      3

83       2       45      4

98       2       67      5

98      2        98      7

I have a simple table with grouping by key, in this table if I select the key 2, and I write the following expression, NumSum(min(rownum),1), the result is  5 , and is correct, but I need do the average for a determinate quantity of records for example, the average for records 4 and 5 only (always grouping by key).

I write this expression:

Avg(if(NumRow<=NumSum(min(numRow),2),value)) --> Error in expresion

NumAvg(If(NumRow<=NumSum(min(numRow),2),value)) --> Expresion is OK, but not appear nothing in the table.

0 Replies