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: 
jedixo04
Contributor II
Contributor II

Above Function not working in my column expression

I have a table that is filtered on a Start Date and part number.  With that it shows the daily usage which in this example is 84.  This needs to be substracted from the overall total.  Any deliveries need to be added.  In my attached image I'm needing to perform a running total from the start date.  I can get the first two days utilizing an if statement but I'm having trouble getting the Above('test') to pull in the value for cell above.  If someone could point me in the right direction thanks. 2024-02-13 11_14_03-Window.png2024-02-13 11_14_37-Window.png

Labels (2)
4 Replies
hic
Former Employee
Former Employee

Don't use single quotes around 'test'. Use double quotes "test" or no quotes.

And - if "test" refers to a measure name (and not a field name) you cannot wrap it in the Sum() function.

jedixo04
Contributor II
Contributor II
Author

Thanks for your reply.  I've changed this as you requested and now I have an Error in Expression.  See below.  Any further help I would greatly appreciate.

jedixo04
Contributor II
Contributor II
Author

2024-02-26 09_33_35-Window.png

hic
Former Employee
Former Employee

I cannot see the entire error message in the screen dump, so I might miss something...

But I see the following problems;
1) Do you really want "Sum(vBeginningInventory)"? Where "vBeginningInventory" is a variable? Sum() should use an expression based on fields as parameter.

2) You use CFDATE and [Start Date] as naked field references. This will cause problems if there is more than one value. See https://community.qlik.com/t5/Design/Use-Aggregation-Functions/ba-p/1475833.

3) You use Above("test")-Sum(QTYPER5DAY). But this will not work for the first row, since Above() will return NULL - and the NULL may ripple down to subsequent rows. Use RangeSum(Above("test"),-Sum(QTYPER5DAY)) instead. Note the comma between the terms.