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

QVDCreatedTime not working

Can someone please tell me what is wrong in the below code?

When i run the load of Table2 without if loop, it loads fine. However, when i run it inside IF loop, load does not happen, although Table2.qvd already exists in the specified path.

Let vSource='C:\Users\Punit\Desktop\';

LET vTable='Table2.qvd';

If (NOT IsNull($(vSource)$(vTable))) then

LOAD MRPDetails,

     MRPEN,

     WW_Vendor_No,

     Date,

     Quantity

FROM

[$(vSource)Table2.qvd]

(qvd);

ENDIF;

1 Solution

Accepted Solutions
sunny_talwar

Try this:

SET vSource = 'C:\Users\Punit\Desktop\Table2.qvd';

LET vExist = If(FileSize(vSource)> 0, -1, 0);

IF $(vExist) then

    

     LOAD MRPDetails,

          MRPEN,

          WW_Vendor_No,

          Date,

          Quantity

     FROM

     [$(vSource)Table2.qvd]

     (qvd);

ENDIF;

View solution in original post

3 Replies
sunny_talwar

Try this:

SET vSource = 'C:\Users\Punit\Desktop\Table2.qvd';

LET vExist = If(FileSize(vSource)> 0, -1, 0);

IF $(vExist) then

    

     LOAD MRPDetails,

          MRPEN,

          WW_Vendor_No,

          Date,

          Quantity

     FROM

     [$(vSource)Table2.qvd]

     (qvd);

ENDIF;

swuehl
MVP
MVP

Try using single quotes in ISNULL function

Let vSource='C:\Users\Punit\Desktop\';

LET vTable='Table2.qvd';

If (NOT IsNull('$(vSource)$(vTable)')) then

LOAD MRPDetails,

     MRPEN,

     WW_Vendor_No,

     Date,

     Quantity

FROM

[$(vSource)Table2.qvd]

(qvd);

ENDIF;

Not applicable
Author

Thanks.Both the solutions work for me.