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

I'm facing a big issue I need help

Hi to everyone,

I'm a new qlikview developper, am facing an issue and I need your help.

I get the links (in the field SourceFile) of all my word files inside a folder using the following procedure:

Set vConcatenate = ;

FileList:

LOAD

'' AS SourceFile

AUTOGENERATE 0;

sub ScanFolder(Root)

          for each FileExtension in 'doc'

                    for each FoundFile in filelist( Root & '\*.' & FileExtension)

                              FileList:

                              LOAD '$(FoundFile)' as SourceFile

       AUTOGENERATE 1;

                             

                              Set vConcatenate = Concatenate;

                    next FoundFile

          next FileExtension

          for each SubDirectory in dirlist( Root & '\*' )

                    call ScanFolder(SubDirectory)

          next SubDirectory

end sub

Call ScanFolder('\\mboko\tdb\Indicateurs') ;

then I test if those links contain certain values (those values are in the field INDICATOR) through the following expression:

=if(Index(SourceFile,INDICATEUR) <> 0,SourceFile)

when I put this expression in a selection list I got the good results

I decided then to create a variable vUrl which contain the expression above. The problem I face is that this variable doesn't output any result. I don't know what I'm doing wrong.

Thanks in advance

8 Replies
Not applicable
Author

Nobody to help me ?

gmoraleswit
Partner - Creator II
Partner - Creator II

have you tried this:  $(vUrl)  ?

Not applicable
Author

Yes, I've already tried this but it doesn't work

gmoraleswit
Partner - Creator II
Partner - Creator II

Can you upload an example?

Not applicable
Author

expressions_and_the_results.PNG.pngvariables_and_the_results.PNG.pngview_of_variables.PNG.png

m_woolf
Master II
Master II

The expression doesn't return a single value. It returns a set or records.

If you create a list box and use the variable as the expression, you will probably see the correct results.

gmoraleswit
Partner - Creator II
Partner - Creator II

Hum...try deleting the '=' sign in the variable definition

Not applicable
Author

If you defined your vUrl variable inside the UI in the Variable Overview screen, wrap the expression in single quotes:

='if(Index(SourceFile, INDICATOR) <> 0,SourceFile)'

Update:

Or try to add the expression in the script:

SET vUrl = if(Index(SourceFile, INDICATOR) <> 0,SourceFile);