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: 
jim_chan
Specialist
Specialist

Issue create Monthly QVD(with script and error provided)

Hi all!

I am trying to run this script to create monthly qvd by reading daily qvd file. however, i hit error.  this is the error, which i dont know how to fix it. Please help 🙂

jim_chan_0-1663930179968.png

 

My script is as below:

Month:
Load Distinct
UPPER(Month(CAL_DAY)) & '-' & Year(CAL_DAY) as MONTH_YEAR
FROM [lib://QVD/Sales/SUM_SALES_DAILY_2021*.qvd](qvd);

Let vCount = noofrows('Month');

LET vYearMonth = peek('MONTH_YEAR ',$(i),'Month');
LET vYear = right($(vYearMonth),4);
LET vMonth = left($(vYearMonth),2);

$(vYearMonth):

Load * from
FROM [lib://QVD/Sales/SUM_SALES_DAILY_2021*.qvd](qvd)
where Month(CAL_DAY) = $(vMonth) AND year(CAL_DAY) = $(vYear);

//Store $(vMonth) into D:\DAILY_REPORT_$(vYYYY)$(vMonth).qvd;
STORE $(vYearMonth) INTO [lib://QVD/Sales/HISTORICAL/MONTHLY_SUM_SALES_ARTICLE_$(vYearMonth).qvd](QVD);

Drop Table $(vYearMonth);

Next

3 Replies
Mark_Little
Luminary
Luminary

 Hi @jim_chan 

Looks like it does like what is Set in the variable $(i)

 

Add this line and relaod should see the value in the variable and be able to correct from there

TRACE $(i)

LET vYearMonth = peek('MONTH_YEAR ',$(i),'Month');
LET vYear = right($(vYearMonth),4);
LET vMonth = left($(vYearMonth),2);

jim_chan
Specialist
Specialist
Author

ok  i m trying it now.

jim_chan
Specialist
Specialist
Author

seems like the same. after added the TRACE.

jim_chan_0-1663931562976.png