Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
labo2002
Contributor II
Contributor II

Qlik Sense || Display newly added record

Hello all.

I am currently hosting a file that is seldom being updated by the user. They wanted to display in a KPI view the count of new record added.

For example:

Records are until August 31 2019. Then I added 1 record on September 2 2019. We wanted to display that there is 1 new record added. 

Appreciate your help on this. 

1 Solution

Accepted Solutions
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,
What I will suggest is, if the old data is coming from QVD file,  you can create a flag (a field in the script) with value of 0 & 1.

Where the old records will have value of zero (0) and new record will have value of 1. Then in UI you can have the expression for your KPI as

COUNT( {< %OldNewRecord ={1}>} [%AllData])

If you have timestamp from datasource you might also want to use last reload time as a determinants to determine which records is new and old.

Your script needs to look something like this below.

DataTable:

LOAD fld1, fld2, fld3 ......, 0 AS  %OldNewRecord FROM [lib://FolderConnection/myfile.qvd](QVD);

CONCATENATE(DataTable)

LOAD fld1, fld2, fld3 ......, 1 AS  %OldNewRecord FROM .....DataSource;

 

STORE DataTable INTO [lib://FolderConnection/myfile.qvd](QVD);

View solution in original post

1 Reply
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,
What I will suggest is, if the old data is coming from QVD file,  you can create a flag (a field in the script) with value of 0 & 1.

Where the old records will have value of zero (0) and new record will have value of 1. Then in UI you can have the expression for your KPI as

COUNT( {< %OldNewRecord ={1}>} [%AllData])

If you have timestamp from datasource you might also want to use last reload time as a determinants to determine which records is new and old.

Your script needs to look something like this below.

DataTable:

LOAD fld1, fld2, fld3 ......, 0 AS  %OldNewRecord FROM [lib://FolderConnection/myfile.qvd](QVD);

CONCATENATE(DataTable)

LOAD fld1, fld2, fld3 ......, 1 AS  %OldNewRecord FROM .....DataSource;

 

STORE DataTable INTO [lib://FolderConnection/myfile.qvd](QVD);