Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jerem1234
Specialist II
Specialist 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
swuehl
MVP
MVP

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.

View solution in original post

2 Replies
swuehl
MVP
MVP

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
Specialist II
Specialist II
Author

Thanks a lot! That does exactly what I needed.