Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Load scritpts function NoOfRow with variable as tablename

I'm trying to show the number of rows in a load script.  It works when I wirte directly the name of the table in the function noOfRows, but is does not if I use a variable (for every other purpose the variable works).

Here a sample

SET TABLE_NAME_03 = Monthly_Sales;

$(TABLE_NAME_03):
LOAD
*
 

FROM
$(TABLE_NAME_03)_2016.qvd
(
qvd)

let Rows_in_structure = NoOfRows($(TABLE_NAME_03)); => This line returns always NULL
let Rows_in_structure = NoOfRows('Monthly_Sales'); => This line returns the correct number of rows.

Does anybody knows how to use variable with the function NoOfRows?

Thank for your help

Tags (1)
1 Solution

Accepted Solutions

Re: Load scritpts function NoOfRow with variable as tablename

Try this two ways for this

1. let Rows_in_structure = NoOfRows(TABLE_NAME_03);  //Without bracket and comma

2. let Rows_in_structure = NoOfRows('$(TABLE_NAME_03)'); //With comma

Regards

Anand

4 Replies

Re: Load scritpts function NoOfRow with variable as tablename

May be try single quotes around your variable:

LET Rows_in_structure = NoOfRows('$(TABLE_NAME_03)');

Re: Load scritpts function NoOfRow with variable as tablename

Try this two ways for this

1. let Rows_in_structure = NoOfRows(TABLE_NAME_03);  //Without bracket and comma

2. let Rows_in_structure = NoOfRows('$(TABLE_NAME_03)'); //With comma

Regards

Anand

Not applicable

Re: Load scritpts function NoOfRow with variable as tablename

Hi, both versions (with comma) and (without comma and brakets) works.

Re: Load scritpts function NoOfRow with variable as tablename

I provided one of those options, you seemed to not like my response .

Just kidding, I am glad we were able to help you out here

Community Browser