Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

how to get last record??

Hi All,

I am using one excel sheet in my qlikview application. this excel contains data like

   

(PDH-CSV 4.0) (India Standard Time)(-330)\\Memory\% Committed Bytes In Use\\Processor(_Total)\% Processor Time
17:18.242.06360428
17:28.241.6983279917.59109493
17:38.241.6497185812.45009383
17:48.241.6186164912.72759386
17:58.241.6301064311.94525163
18:08.241.85406134

12.58417061

Now I want to load last loaded record for all three fields in 3 different variables during load time. For example

Values shold be after load:

vTime = 18:08:2

vByte = 41.85406134

vProcessTime = 12.58417061

How I will get this?

Thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Let vTime = Peek('(PDH-CSV 4.0) (India Standard Time)(-330)', -1, 'TABLENAME');

other variables accordingly, changing the field name.

View solution in original post

9 Replies
swuehl
MVP
MVP

Let vTime = Peek('(PDH-CSV 4.0) (India Standard Time)(-330)', -1, 'TABLENAME');

other variables accordingly, changing the field name.

Anil_Babu_Samineni

Some one discussed by previous : https://community.qlikview.com/thread/68081

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Try this:

Table:

LOAD Time#([(PDH-CSV 4.0) (India Standard Time)(-330)], 'mm:ss.f') as [(PDH-CSV 4.0) (India Standard Time)(-330)],

     [\\Memory\% Committed Bytes In Use],

     [\\Processor(_Total)\% Processor Time]

FROM

[https://community.qlik.com/thread/214755]

(html, codepage is 1252, embedded labels, table is @1);

Max:

LOAD FirstSortedValue([(PDH-CSV 4.0) (India Standard Time)(-330)], -[(PDH-CSV 4.0) (India Standard Time)(-330)]) as MaxTime,

  FirstSortedValue([\\Memory\% Committed Bytes In Use], -[(PDH-CSV 4.0) (India Standard Time)(-330)]) as MaxByte,

  FirstSortedValue([\\Processor(_Total)\% Processor Time], -[(PDH-CSV 4.0) (India Standard Time)(-330)]) as MaxProcessTime

Resident Table;

LET vTime = Peek('MaxTime', -1, 'Max');

LET vByte = Peek('MaxByte', -1, 'Max');

LET vProcessTime = Peek('MaxProcessTime', -1, 'Max');

DROP Table Max;

Anonymous
Not applicable

let vTime= peek(fieldname , -1, tablename) ..check how to use peek.

sunny_talwar

Stefan -

Wouldn't this require the table to be sorted correctly? As it will always pick the last value in the load? Not sure if that is what is required, but I just wanted to confirm

swuehl
MVP
MVP

Well, it was asked for 'Now I want to load last loaded record for all three fields in 3 different variables during load time'.

That's what the Peek() functions return.

sunny_talwar

So it won't check for the sorting, right? Just for my knowledge, OP may be looking for what you have, but I want to make sure I understand Peek()

swuehl
MVP
MVP

Right, it won't care if the data is sorted.

It just returns a value from a specified row of your resident table (in this case, the last row).

But the data looks like a performance monitor log, already sorted. Assumingly last record -> latest record.

sunny_talwar

This one is, but in case it isn't then last one will be picked. That makes sense.

Thanks Stefan