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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

Above Function

Hi All,

Please correct my expression.

I am using Sum(Sales - Above(Sales)), it shaowing error. whats wron in this expression.

Please suggest.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

What you want to achieve?

You have to select something to get output in text file or use aggr function like below

=Max(Aggr(Sum(Sales) - Above(Sum(Sales)),Sales))

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Sum(Sales) - Above(Sum(Sales))

or

Sum(Sales) - Above(Sales)

its_anandrjs
Champion III
Champion III

Expression is wrong you have to try

Sum(Sales) - Above(Sales)


soha1902
Creator
Creator
Author

I tried but now its showing nothing.

Please find attached sample app.

MK_QSL
MVP
MVP

What you want to achieve?

You have to select something to get output in text file or use aggr function like below

=Max(Aggr(Sum(Sales) - Above(Sum(Sales)),Sales))

Not applicable

Hi Soha,

Try using Sum(Aggr(Sum(Sales) - Above(Sum(Sales)),Sales)) for your requirement.

Regards,

Sabal

its_anandrjs
Champion III
Champion III

In chart expression you have to use


Sum(Sales) - Above(Sales)


But in text object why you use Sum(Sales) - Above(Sales) it is not good practice what ever you can use this expression will give correct result but sales value not used in aggregation expression some other dimensions are used.


=Max( Aggr( Sum(Sales) - Above(Sum(Sales)),Sales))

hic
Former Employee
Former Employee

No, no, no... !!!!

This is a typical case when you don't need the Aggr() function - and probably shouldn't use it. Instead you should just use normal aggregation functions. And note that Above() is not an aggregation function. The correct way to write it is:

     Sum(Sales) - Above(Sum(Sales))

or, if you want to avoid the problem with NULL values:

     RangeSum( Sum(Sales), -Above(Sum(Sales)) )

HIC