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

Why i am not getting same result with Above function ?

Hi All ,

Why i am not getting same result with Above function used in two different expression , below :

1) Sum({1<Year={"=Above(Year)"}>}[Foreign Exchange Reserves in US Dollar - Total])

2) Above([Foreign Exchange Reserves in US Dollar - Total],1)

Thanks & Regards

Shekar

1 Solution

Accepted Solutions
tresesco
MVP
MVP

I guess the behavior could be explained like below:

The trick is the '=' sign in the set ( '=Above(Year)'). When we put that, set analysis actually gets evaluated for TRUE condition of the field. Like, if you write : Customer={"=Sum(Sales)>0"}, then we are searching for those customers against whom the condition is true; and not for specific values of customers. Similarly, when we write Year={"=Above(Year)"}, it sees if there is an above value for that year (if it has an early/above value then it's a TRUE) or not. And obviously, it's true (present) for all the years except the first one.

If we use below() instead, we would see all the values except the last one.

I am sure that the same (what I am trying to express) could have been explain in a much better way, but hope - what I wrote is conveyed and makes sense.

View solution in original post

20 Replies
stabben23
Partner - Master
Partner - Master

maybe change here?

2) Above([Foreign Exchange Reserves in US Dollar - Total],0)

0 instead of 1

jonathandienst
Partner - Champion III
Partner - Champion III

I doubt that the Above() inside the set expression is working at all. Above() is a chart function, while the set expression is executed before the chart is constructed. So the Above() function has no context and will probably return null.. The set expression will fail silently (ie be ignored) so your first expression will be effectively:

    Sum({1} [Foreign Exchange Reserves in US Dollar - Total])

     or

    Sum([Foreign Exchange Reserves in US Dollar - Total])

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
stabben23
Partner - Master
Partner - Master

sorry, misunderstand the problem

Anil_Babu_Samineni

You want to see which one?

Capture.JPGCapture1.JPG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shekhar_analyti
Specialist
Specialist
Author

Hi Jonathan ,

So you mean to say that , Above function should not be used with set expression as an ideal case . Please correct me , if i got it wrong .

shekhar_analyti
Specialist
Specialist
Author

Hi Anil ,

I wanted to know that , what is wrong with my first expression .

sunny_talwar

I agree with jontydkpi‌... I don't think Above is even working.... I would have thought for it to show no result at all... but it seems that the set analysis is ignored.... the reason I though it would not work is because if you create a chart with Year as dimension and Above(Year) as expression... you would see that Year is never equal to Above(Year)

Capture.PNG

Since the set analysis you have used is a search string... only those years where Year = Above(Year) should be included... but that never happens... so nothing should be included...

But that is not what happens, it appears as though the complete year set analysis part is completely ignored... don't know why.... may be hic‌ can tell why

shekhar_analyti
Specialist
Specialist
Author


If someone like Sunny is not sure , then think of my situation . .
Anyways i am glad that , there is finally something about which Sunny is not sure ... ..

Anil_Babu_Samineni

Interest Question

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful