Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change the if condition

Hi We are Loading QVDs  from Database based on the below code

if not isnull(QVDCreateTime('$(vQVDPath)IDS_$(tableName).qvd')) then

LoadTime:

Load Max(LastModifiedDate) as LastModifiedDate // Or max(CreatedDate)

From $(vQVDPath)IDS_$(tableName).qvd (qvd);

Let vLastExecTime = timestamp(peek('LastModifiedDate',0,'LoadTime'),'YYYY-MM-DD hh:mm:ss');

//Let LastModifiedTimestamp = '$(vLastExecTime)';

Drop Table LoadTime;

ELSE

  Call FullTableLoad(tableName);

  EXIT SUB;

end if;

According to this if QVD is not AVailable on that particular path its doing a full load,

now what we need is  if QVD is Availbale and contains 0 records then again  it has do a full load

we need to write and if condition here. please help me

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

Try this

if not isnull(QVDCreateTime('$(vQVDPath)IDS_$(tableName).qvd')) or (exists('$(vQVDPath)IDS_$(tableName).qvd') and QvdNoOfRecords('$(vQVDPath)IDS_$(tableName).qvd')=0)  ) then

LoadTime:

Load Max(LastModifiedDate) as LastModifiedDate // Or max(CreatedDate)

From $(vQVDPath)IDS_$(tableName).qvd (qvd);

Let vLastExecTime = timestamp(peek('LastModifiedDate',0,'LoadTime'),'YYYY-MM-DD hh:mm:ss');

//Let LastModifiedTimestamp = '$(vLastExecTime)';

Drop Table LoadTime;

ELSE

  Call FullTableLoad(tableName);

  EXIT SUB;

end if;

hope this helps

Sunil Chauhan

View solution in original post

4 Replies
sujeetsingh
Master III
Master III

Use row count function in your iff

sujeetsingh
Master III
Master III

some thing like this

Let RowCount= NoOfRows('ActionCheck');

If '$(RowCount)' <> '0' THEN

Here Action check is a table.

You can call the qvd and do full reload and then check for the NoOf Rows

SunilChauhan
Champion II
Champion II

Try this

if not isnull(QVDCreateTime('$(vQVDPath)IDS_$(tableName).qvd')) or (exists('$(vQVDPath)IDS_$(tableName).qvd') and QvdNoOfRecords('$(vQVDPath)IDS_$(tableName).qvd')=0)  ) then

LoadTime:

Load Max(LastModifiedDate) as LastModifiedDate // Or max(CreatedDate)

From $(vQVDPath)IDS_$(tableName).qvd (qvd);

Let vLastExecTime = timestamp(peek('LastModifiedDate',0,'LoadTime'),'YYYY-MM-DD hh:mm:ss');

//Let LastModifiedTimestamp = '$(vLastExecTime)';

Drop Table LoadTime;

ELSE

  Call FullTableLoad(tableName);

  EXIT SUB;

end if;

hope this helps

Sunil Chauhan
Not applicable
Author

Hi Sunil,

             Thanks for the Reply ,

Yes It Will work .Thanks a Lot

Regards

Abi