Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional Load statement (Checking for table existence while loading)

Hi All,

I have a requirement in Qlikview where I need to display the total quarter wise. My approach was to create quarter wise data from the main table (i.e. create separate table for each quarter) and then calculating the total, after which combining the separate quarter tables into a single table. While doing this, qlikview throws an error since my last two quarters data is unavailable and hence the table is empty. Is there any way to check whether table contains data while loading it?

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

you can add a rowno() to the loading table and then check if this is higher than one

Table

load:

field1,

field2,

rowno() as Rowno

from data

if max(Rowno)>= 1 then


     whatever goes here




end if 

View solution in original post

3 Replies
sunny_talwar

Are you trying to check a external file (like a Excel file) to see if it exists or not? or is it during a resident load?

External file can be checked like this:

Set vFile = 'Data\XYZ.qvd'; //Path of the file where you have to check

Let vFileExist = If(FileSize(vFile) > 0, -1, 0); /* Checking if the file exist in the directory. */

IF $(vFileExist) then

    

     ....

ENDIF

I hope this helps.

Best,

Sunny

ramoncova06
Partner - Specialist III
Partner - Specialist III

you can add a rowno() to the loading table and then check if this is higher than one

Table

load:

field1,

field2,

rowno() as Rowno

from data

if max(Rowno)>= 1 then


     whatever goes here




end if 

Anonymous
Not applicable
Author

if(NoofRows('Table1')>0)then

//Load

//Resident table1;

Endif

This condition works.

Thanks everyone for you help

Thanks!