Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

count records before and after reload

Hi,

i'm trying to build a function that detects changes after reload, but the following script is not working.

Why are the values of the both variables are the same.

I expected that the value of vRecordsPreLoadCount is 0 before the load, but both variables contains 4.

LET vRecordsPreLoadCount = 'Count(Id)'; 

data:
LOAD * INLINE [
Id
10
10
11
12
13
]
;

LET vRecordsPostLoadCount = '=Count(Id)'; 


Do I have to change the formulas?


Thank you!

4 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

HI Matthias,

You need to store it into separate file and  after reload pick from it.

Thanks,

Arvind Patil

techvarun
Specialist II
Specialist II

Use Table Name not the field name

LET vRecordsPostLoadCount = NoOfRows('data');

effinty2112
Master
Master

Hi Matthias,

In script use NoOfRows('data') instead. Count('Id') can be used in the interface or in the script as part of a aggregration Group by load after which you would need the Peek function to obtain the value.

In this script use NoOfRows('data') instead.

Before load this will be null. After load will equal 5.

Cheers

Andrew

techvarun
Specialist II
Specialist II

Try the below script its working

Binary \\Load the same qvw and dont forget to save after every reload;

LOAD * Resident data;

let vRecordsPreLoadCount = NoOfRows('data');

DROP TABLE data;

data:

LOAD * INLINE [

Id

10

10

11

12

12

15

14

15

];

LET vRecordsPostLoadCount = NoOfRows('data');