Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

jerem1234
Valued Contributor II

What is a good way to tell if a table loaded in has no data?

Hello Everyone,

     I was wondering what a good way would be to tell if a table that is loaded in has no data. To clarify, I am using script like:

Table1:

NOCONCATENATE LOAD *

Resident Data

where A = 1 and B like '$(vName)';

Now it may be that the part "B like '$(vName)'" might not pull anything in because it does not match any values. This would make the table blank with no data inside (like if you went to table viewer and cannot preview data because nothing is there).

If that is the case, I want to Concatenate onto it with something that does have data like:

Concatenate(Table1)

Load *

Resident Data

where A =1 and B like 'HardCodedValue';

But I don't want it where I concatenate the table with this new data if there is already something there. So I'm wondering if there is any good way to say "If the Table1 has no data, then concatenate"?

Thanks!

1 Solution

Accepted Solutions
MVP
MVP

Re: What is a good way to tell if a table loaded in has no data?

You can use the system function to retrieve the number of rows of your resident table (I think it's called NoOfRows(TableName), but check the HELP). Use the result of the system function in a control flow using IF .. THEN .. ELSE.

2 Replies
MVP
MVP

Re: What is a good way to tell if a table loaded in has no data?

You can use the system function to retrieve the number of rows of your resident table (I think it's called NoOfRows(TableName), but check the HELP). Use the result of the system function in a control flow using IF .. THEN .. ELSE.

jerem1234
Valued Contributor II

Re: What is a good way to tell if a table loaded in has no data?

Thanks a lot! That does exactly what I needed.

Community Browser