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

Above row value with dimension

Dear All,

am created the below pivot table with dimensions S.No., Particulars & Date and with 3 Expressions

Problem :  if Rate / Unit is blank for particular day we need to take previous Rate / Unit 

Note : i can't use set analysis because Rate / Unit Expression formula is very big so trying to use above() function or to read previous column (1) value,   but not able to get the same

Tried Expressions :

=aggr(rangesum(above(column(1),1,2)),[S.No],Particulars,Period)

=       rangesum(above(column(1),1,2))

Period01-12-201602-12-2016
S.No.ParticularsRate / UnitCFRate / TRate / UnitCFRate / T
1abcd1545.700.751159.610.98
6 Replies
PrashantSangle

Hi,

In script you can use peek()

for example:

Test:

LOAD ID,if(len(trim(Sales))=0,Peek(Sales),Sales) as Sales,UPPER(NAME) as NAME INLINE [

ID,Sales,NAME

1,100,PRASHANT

2,,mahesh

3,,c

4,400,d

];

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

As i already explained in my previous post that Rate / Unit is an expression with big formula calculates run time based on user selection criteria so can't write in Script.

Thanks ... 

petter
Partner - Champion III
Partner - Champion III

You will have to use Before() instead of Above() in a pivot table if you are referring to a column to the left.

So your expression should have something like this pattern:

If( IsNull( Rate ) , Before( Column(1) ) , <Complex-Rate-Unit-Calc> )

The second and third parameters for Before() aren't necessary because the second tells the offset which defaults to 1 and the third is the number of values (count) that you want in the result and that should be only 1 which is also default. The same goes for Above() which you used.

pathiqvd
Creator III
Creator III

Hi,

     Use "before" in place of "Above" function.

Regards,

Not applicable
Author

Hi,


Thanks for response, i tried with your formula


its working if i add a new expression field as testing as shown in below table but it is not working when am writing the same style in expression Rate / Unit


          

Period01-12-201602-12-2016
S.No.ParticularsRate / UnitCFRate / TTestingRate / UnitCFRate / TTesting
1abcd1545.700.751159.610.981545.70
Not applicable
Author

by doing small change it worked fine.

Thanks....