Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Do not compute expression if it is the last record

Hi,

How do i set a conditional that will not run the following computation if it is the last record ?

Record field name is S/NO

If not equal last record of S/NO then (ProcessTimeMin*60 +ProcessTimeSec) / 60

Regards

Jiawei

5 Replies
Not applicable
Author

How about adding the record number to the table on LOAD of the table as a field. Something like this


Table:
LOAD
RecNo() AS TableRecord,
...


Then use Max(TableRecord) in your calculation.

johnw
Champion III
Champion III

Perhaps sort the records in reverse sequence, and then:

if(recno()>1,ProcessTimeMin+ProcessTimeSec/60)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming you are doing a RESIDENT load from a table named "data", you can do this:

if(recno() < NoOfRows('data'), ProcessTimeMin+ProcessTimeSec/60)

-Rob

Not applicable
Author

Thanks for your kind assistance. I tried using the recommended solutions under the "Processing Time" table Chart but it doesn't seem to work.

I have attached my qlikview report for your reference.

My problem is based on the date and time selection, i want to know the time difference between the entries within that time frame. If it is the last record, it should not do any computation with the next record that is outside the time frame. Currently, it is doing so and giving me skewed computation.

So i am thinking of a conditional statement to stop the table to compute if it comes to the last record.

IF not equal last record then ((ProcessTimeMin*60 +ProcessTimeSec) / 60)

Not applicable
Author

Can anyone guide me on the last issue of my report? How can i prevent the last record to compute time diff of the next record of a different time frame?