Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michael_gardner
Contributor III

Trace # of New Rows added to Table in Load

I have a script that loads only new records from a Source table into a QVD.  I want to be able to state the # of new rows that are being loaded in a Trace Statement.  See below for an example.

Sales:
Load ID,*

From QVD;

TRACE New Rows being loaded;

CONCATENATE (Sales)

Sales:

Load ID,*

From Source

WHERE NOT EXIST ID;

TRACE "x" rows loaded into Sales;

1 Solution

Accepted Solutions
eduardo_sommer
Valued Contributor

Re: Trace # of New Rows added to Table in Load

Hi Michael

You can use the function NoOfRows(NameOfTable)

After the first load, you assign NoOfRows to a varable, trace the value and do the same after the second load

Let vNumberOfRows = NoOfRows(Sales);

Trace $(vNumberOfRows);

Eduardo

3 Replies
eduardo_sommer
Valued Contributor

Re: Trace # of New Rows added to Table in Load

Hi Michael

You can use the function NoOfRows(NameOfTable)

After the first load, you assign NoOfRows to a varable, trace the value and do the same after the second load

Let vNumberOfRows = NoOfRows(Sales);

Trace $(vNumberOfRows);

Eduardo

Highlighted

Re: Trace # of New Rows added to Table in Load

You need to create a Variable like below

Let vNoOfRows = NoOfRows('TableName');

Trace $(vNoOfRows);

michael_gardner
Contributor III

Re: Trace # of New Rows added to Table in Load

I had to put a If statement to show 0 row if none were added but it worked.  Thanks for the quick response.

Sales:
Load ID,*

From QVD;

TRACE New Rows being loaded;

CONCATENATE (Sales)

Sales:

Load ID,*

From Source

WHERE NOT EXIST ID;

LET vNumberofRows = IF(LEN(TRIM(NoOfRows('Sales')))=0,0,NoOfRows('Sales'));

Trace $(vNumberofRows) rows added;