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: 
canmarroig
Partner - Creator
Partner - Creator

How to detect a missing month in script

I've a problem i'd like you to help me to solve: i've 3 different sources to use to import data:

- an excel for the current month: A.xls

- 12 file for the previous 12 months: yearmonth_B.xls

- in case of lack of the previous month, i've a further excel file. C.xls

For instance: today my A file is 201410.xls, if I can't find B file 201409.xls 'ive to use C.xls

I've created 2 variables:

let vMonthMax=peek('Month',0,tmp)

let vMonthPrec=peek('Month_prec',0,tmp)

but i've no idea how to put the condition to check if there is file B. Can you help me?

Tks

2 Replies
Not applicable

Hi

you can use the below.

if  isnull(FileTime($(vMonthPrec) & '.xls')) then

     Load from c.xls

else load from B.xls

End if

martyn_birzys
Creator
Creator