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

How to return the last value in a column

Hi All,

I have searched and searched through these questions and I can't find an answer that works for me. I have a table with multiple columns like so:   

DateFeb FCMar FC
1-Jan3533
2-Jan3734
3-Jan3835
4-Jan4036
5-Jan4237
6-Jan3738
7-Jan3437
8-Jan4340
9-Jan41
10-Jan42
11-Jan40
12-Jan44
13-Jan
14-Jan
15-Jan

I want to return the last value that is not null in the column and use it in a chart. I tried bottom() and looked into firstsortedvalue() to achieve this but I was unable to come up with a solution. Assuming this data will change daily (as more values are added) how would I find the last value in the column and return it as the Month to date value (ie JanMTD would be 43). From this data set I would then need to create table with a Month column and the corresponding MTD value like so:

   

FCFebMar
Forecast4344

   

Many thanks!!  

   

1 Reply
sunny_talwar

May be this:

FirstSortedValu({<[Feb FC] = {"=Len(Trim([Feb FC])) > 0"}>}[Feb FC], -Date)

FirstSortedValu({<[Mar FC] = {"=Len(Trim([Mar FC])) > 0"}>}[Mar FC], -Date)