Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
riho92qv
Contributor III
Contributor III

script Qlikviewto Qliksense

Hi

I have a number of months of data files and need to read the last 24. Everything works fine in Qlikview, but not in QlikSense. I tried to add and remove the Lib: phrase, but that's probably not the problem. Can anyone give advice on how to arrange this loading in QlikSenses?

Riho

SET ErrorMode = 0;

LET vPeriod = 24;

For a = 2 to $(vPeriod)

                LET vYearMonthtoLoad = Date(AddMonths(Today(),-$(a)),'YYYY-MM'); // create the YYYYMM affix that will be used in the load

  DATA:

                LOAD Year_Month,

                                Year(InvoiceDate) as Year,

                                Num(Month(InvoiceDate)) as Month,

                     Tehas,

                     Osakond,

                    .  .  .  .  .

                     Tulem3,

                     Tulem3%,

                     SumSellingShipQty,

                     InvoiceLine1

                FROM

                [Lib:\\infoait\Andmed\Juhtimine\Analyys\Aruanded\Jooksvad\Kuude katte ja kasumi analüüsi failid\$(vYearMonthtoLoad) exceli baasleht_r2.xls]

                (biff, embedded labels, table is Leht1$) ;

next a;

if ScriptError=8 then

exit script;

end if

1 Reply
rubenmarin

Hi, you'll need a lib:, this would be the data connection that targets the folder where the files are stored, or some folder above where you can add subfolder path.

If you create the folder data connection that targets \\infoait\Andmed\Juhtimine\Analyys\Aruanded the from could be:

 FROM [Lib:\\DataConnectionName\Jooksvad\Kuude katte ja kasumi analüüsi failid\$(vYearMonthtoLoad) exceli baasleht_r2.xls]