Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
don_qlikview
Creator
Creator

Help with Above()

Hello Everyone,

I have a requirement where I have to get the values from previous calculation if the numbers are not present. For example for week 3 & week 4 I need to derive the values from Week 2. So, I am using above() to get to my answer and when I use the above() function the below table1 becomes like that in table 2 as shown

Table 1:


Week



Sum(Amount)



1



1000



2



2000



3



0



4



0



5



3000


Table 2:


Week



Above(Sum(Amount))



1



1000



2



2000



3



2000



4



0



5



3000


I want to have Week 4 also as 2000. So, can anyone help me to get that or is there a better way to do this?

Thanks,

Don

1 Solution

Accepted Solutions
peschu123
Partner - Creator III
Partner - Creator III

Hi,

take a look at attached example.

View solution in original post

8 Replies
Not applicable

would using sum(above(amount)) be a better representation of what you're trying to go for?

don_qlikview
Creator
Creator
Author

Hi Robert,

I want to show Week 4 as also 2000.

Not applicable

I'm not sure I fully understand what your scenario is, could you share  a sample qvw?

don_qlikview
Creator
Creator
Author

I have attached a sample QVW...

peschu123
Partner - Creator III
Partner - Creator III

Hi Don,

please take look at attached script file. Its not an exact answer on your question but perhaps it helps.

I would say the reason why above "doesn't work" in week 4 is because sum(Amount) in week3 = 0. If you know that this happens only 2 times you could just use another "IF".

Like that:

IF(sum(Amount)=0,IF(Above(sum(Amount))=0,Above(sum(Amount),2),Above(sum(Amount))),Amount)

I have to admit that it looks not very nice and if possible I would do it in script.

If needed I can upload a sample qvw tomorrow.

Best Regards,

Peter

don_qlikview
Creator
Creator
Author

If you can upload a sample qvw, that'll be great... thanks for the help!!!

peschu123
Partner - Creator III
Partner - Creator III

Hi,

take a look at attached example.

don_qlikview
Creator
Creator
Author

This works... Thanks!!!!