Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
AshwinDaniel
Contributor III
Contributor III

Finding the last Not Null value "for KPI without any aggregator" in a field from table bottom (recent value)

Dear Gurus, 

I am looking for an expression to find out a value (Not NULL)  in a field. 

My condition is finding the last value (recent value) in a field. The search should start from the bottom of a column (Field). so that I can obtain a new value when I reload/ push the Data.

The data generate (row) for a particular time interval and leave NULL, if the data not available from the value generator. 

Sample Data table:

AshwinDaniel_0-1628695806855.png

For example:
Initially, it should display "7" in status field after 4th row entry still the next entry occurs in the status field. 

Many thanks in advance

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

@AshwinDaniel  try below

Data:
LOAD Timestamp,
      A,
      B,
      C,
      Status
FROM table;

Final:
LOAD *,
     if(len(trim(Status))=0,peek('Final_Status'),Status) as Final_Status
resident Data
order by Timestamp;

drop table Data;

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Ashwin, can you help us with the expected output with your shown sample data.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Kushal_Chawda

@AshwinDaniel  try below

Data:
LOAD Timestamp,
      A,
      B,
      C,
      Status
FROM table;

Final:
LOAD *,
     if(len(trim(Status))=0,peek('Final_Status'),Status) as Final_Status
resident Data
order by Timestamp;

drop table Data;
AshwinDaniel
Contributor III
Contributor III
Author

Thank you Kushal Chawda for your assistance.

Is there any way to display the last row value using expression?

Many thanks in advance!

Ashwin Daniel

AshwinDaniel
Contributor III
Contributor III
Author

Finally, I could achieved the recent value through load script.

Thank you Kushal.