Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignore first value using Above() function

Is there a way to ignore the first delta value when using the Above() function? I'm plotting the difference in # of users in a system between months, and the first calculation is far above the rest because it's subtracting 0 in the first month (no data for Min(month) - 1). Is there a way to force the first value to be zero?

In the example below I turned the difference into a percentage, but the idea remains:

Capture.PNG

5 Replies
swuehl
MVP
MVP

Maybe like

=if(rowno() = 1,

0,

above(YourExpression)

)

Not applicable
Author

Good thought, however unfortunately this doesn't work. I tried if(RowNo() = 1..) and if(RowNo() = 2...), but neither produced the desired result. It's not placing a zero in the first position the way I would like (RowNo() = 1 didn't change the plot at all - I assume since when I take the difference of (value - PreviousVaue), the calcuation cannot work until the second data point.

Not applicable
Author

I personnaly use a len() function to ignore the first value or put it at 1. You can put whatever you want in else part.

=if(len(Above([Amount Gross Margin]))>0,avg(SaleGrossMargin),'')

Not applicable
Author

hi

try this

=if(rowno() = 1,

' ',

above(YourExpression)

)

note--if you only use one expression then first row automatically supressed because it take as a null value.

hope this helps you.

Regards

swuehl
MVP
MVP

It would be helpful if you could post the complete expression, or even better a small sample app.

above(YourExpression) should return NULL in the first row, not zero, so subtracting above(YourExpression) from YourExpression, like

=sum(UsageCount) - above(sum(UsageCount))

should also be NULL, not equal to sum(UsageCount).