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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mbp198
Contributor III
Contributor III

Dynamic import with wild match


dataimport:
LOAD  @1 AS CoCd,
@2 AS Period,
@3 AS [Doc. Date],
@4 AS [Pstng Date],
@6 AS Reference,
@7 AS DocumentNo,
@8 AS Crcy,
@9 AS Year,
@10 AS [Doc. Type]
FROM

\\cagta5454\Indirect\Clients\\zz Work-in-Progress\2014\data\*_110_*GLDetl*

I want help in dynamic import of a file

currently file is located at

\\cagta5454\Indirect\Clients\\zz Work-in-Progress\2014\data\*_110_*GLDetl*

I am looking for a way so that I can able to do dynamic import

something like creating a variable

$dataLocation = \\cagta5454\Indirect\Clients\\zz Work-in-Progress\2014\data\*_

and $datafiles = '110','121','141'

so that instead of using number for the file containing data ,  I can use  a variable

1 Reply
maxgro
MVP
MVP

maybe

set flist = '110', '111', '112';

for each f in $(flist)

  set file = '\\cagta5454\Indirect\Clients\\zz Work-in-Progress\2014\data\*_$(f)_*GLDetl*';

  trace $(file);

          LOAD  @1 AS CoCd,
                     @2 AS Period,

                      ....

          FROM [$(file)]  ;

next;