Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

How to get updated Records

Hi there,

i have sample data like

ID,
Name,
Dat

AB3.JPG

Currently data shows 3 records with 2 same ID.

AB1.JPG

But i want to show updated data as per date update.
Output should be below screen-shot.

AB2.JPG

Thanks,

DJ

1 Solution

Accepted Solutions
Highlighted

I assume you want the name for the maximum date as well as the date itself for the ID. Use a straight table:

     Dimension: id

     Expr1: FirstSortedValue(Name, -Dat)

     Expr2: Max(Dat)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

7 Replies
Highlighted
MVP
MVP

You mean, if duplicate Ids are there, it should take the one with latest date? If so, you can do it in the front-end easily like:

Straight table:

Dim1:Id

Dim2: Name

Exp: Max(Dat)

In the script like:

Load

          Id,

          Name,

          Max(Dat) as Dat

From <> group by Id, Name;

Highlighted
Not applicable

Hi,

As see Name is different and ID is only same

A:

Load

          Id,

          Name,

          Dat

From Table1 ;

B:

Load

          Id,

          Max(Dat) as Dat

From <> group by Id;

Now Join Table A and B based on Column ID and Dat and fetch all columns from table A.

Highlighted
Partner
Partner

Hi Tresesco,

Yes, Your understanding is right.

But when i excute this logic it will show all data.kindly check.

AB4.JPG

AB 5.JPG

Still it shows the all records.

Thanks,

DJ

Highlighted

I assume you want the name for the maximum date as well as the date itself for the ID. Use a straight table:

     Dimension: id

     Expr1: FirstSortedValue(Name, -Dat)

     Expr2: Max(Dat)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

Highlighted

To do this in the load script:

     LOAD id,

          FirstSortedValue(Name, -Dat) As Name,

          Max(Dat) As Dat

     FROM ...

     GROUP BY id;



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
MVP
MVP

I should have noticed the Name thing earlier. In that case, follow Jonathan's second suggestion below.

Highlighted
Creator II
Creator II

Hi.....

Please find the attachment below.

As said by Jonathan dienst it is correct.

Thanks