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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Only capture latest record in tmap

Hi,

 

I have a question please advise -

 

I am trying to output only latest record in tMap - for below example I only need 3/12/2019 record show in my output report. for now I can only catch all record or the first one. those input data are showing no sequence.

 

Thank you!

Trans DateTime record
3/11/2019 6:51 A
3/12/2019 10:43 A
3/11/2019 8:08 A
Labels (2)
1 Solution

Accepted Solutions
DataTeam1
Creator
Creator

@szhou1 you can do this using tAggregateRow as @vapukov  mentioned.

 

You have to put all your columns to operation panel (not group by)

 

0683p000009M3Z7.jpg

View solution in original post

11 Replies
Anonymous
Not applicable
Author

Are those three records already loaded or this particular record is getting loaded when you run your job, so you wanted to take only with the latest time stamp, can you give bit more details about it

3/12/2019 10:43 A

 

DataTeam1
Creator
Creator

@szhou1 first you need to sort records in descending order

 

0683p000009M3TY.jpg

 

and then filter in tMap using sequence

 

0683p000009M2kr.jpg

 

result:

 

0683p000009M3KY.jpg

DataTeam1
Creator
Creator

But if you want to have natural order you have to use 2x tMap

 

In first you have to add new column with sequence

Then you have tu use tSortRow and sort your rows in descending order of sequence column

Then you can use the second tMap in which you have add filter the same way as I show in my previous post.

vapukov
Master II
Master II

Hi,

 

why just not use tAggregateRow

  • group by - record
  • and take MAX for DateTime

 

cheers

DataTeam1
Creator
Creator

@vapukov , I think @szhou1 needs last record (last row of dataset) not max date

vapukov
Master II
Master II

it still will work, even without group by, just select last

Function: Select the operator among: count, min, max, avg, sum, first, last, list, list(objects), count(distinct), standard deviation.
Anonymous
Not applicable
Author

Thank you.
Can I know What I should fill in Numeric.sequence function? What do "S2" and "1" mean? I checked function description but I still do not know how to apply it. the one I showed was just an example. the trans date can be different in the actual source. for example it also can have 3/6 and 3/9 for the same record. and the record name is random not in sequence
Anonymous
Not applicable
Author

Hi,

I tried to use taggregaterow first and then link with tmap but it did not work well it showed "null point" error. I have other columns to output. I put "record" in group by both input and output. and I put "trans_time" max for the operation. In my tmap I have other columns that I need.
DataTeam1
Creator
Creator

"s2", "s1" etc is an unique name of the sequence. It can be also "blablabla";