Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
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
Partner

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

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

I have attached a sample QVW...

peschu123
Partner
Partner

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

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

peschu123
Partner
Partner

Hi,

take a look at attached example.

View solution in original post

don_qlikview
Creator
Creator

This works... Thanks!!!!