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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

function if()

Hello everyone,

I Have a question about if's function: Can I use this function with a FTP in the condition? Because I want to know if my file exist in this FTP or if it doesn't exist pass to another FTP and can I put a LOAD in the "if". And I always have an error with my "if" with the sign after my condition in red.

for a = 1 to FieldValueCount('Code')

let vCountryCode = FieldValue('Code', $(a));

    for m = 1 to FieldValueCount('Id');

      let vUserId = FieldValue('Id', $(m));

      let vPassword = FieldValue('Password', $(m));


      If([ftp://$(vUserId):$(vPassword)@11.111.11.111/DV/AAA%20AAA%20AAA%20-%20$(vCountryCode)%20-%20AAA%20AAA...] <> 'Null' ,

                YourTable:

                LOAD * FROM [ftp://$(vUserId):$(vPassword)@10.198.32.118/DV/AAA%20AAA%20AAA%20-%20$(vCountryCode)%20-%20AAA%20AAA%20AA.xlsx.xlsx]

                (txt, codepage is 1252, embedded labels, delimiter is ';', no quotes, table is Feuil1);

                STORE CONVERT into TABLESv2/VVV.qvd(qvd);


          NEXT, NEXT)


NEXT



I hope this is not too confuse.

Regards

Labels (1)
2 Replies
sebastianlettner
Partner - Creator
Partner - Creator

Hi,

try using FileSize()

for a = 1 to FieldValueCount('Code')

let vCountryCode = FieldValue('Code', $(a));

    for m = 1 to FieldValueCount('Id');

      let vUserId = FieldValue('Id', $(m));

      let vPassword = FieldValue('Password', $(m));

    

     if(FileSize([ftp://$(vUserId):$(vPassword)@11.111.11.111/DV/AAA%20AAA%20AAA%20-%20$(vCountryCode)%20-%20AAA%20AAA...] )<> Null()) then

    

                YourTable:

                LOAD * FROM [ftp://$(vUserId):$(vPassword)@10.198.32.118/DV/AAA%20AAA%20AAA%20-%20$(vCountryCode)%20-%20AAA%20AAA%20AA.xlsx.xlsx]

                (txt, codepage is 1252, embedded labels, delimiter is ';', no quotes, table is Feuil1);

                STORE CONVERT into TABLESv2/VVV.qvd(qvd);

     endif

    

     NEXT

        


NEXT

buzzy996
Master II
Master II

try this way,

i don't think so qlikview can understand directly, u can create a varaible & paly with tht some how