Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
PavaniGudimetla
Contributor
Contributor

Select filemasks based on day of the week

I am using filemask in tfilelist.

But, I need to use certain filemasks based on day of the week.

For example, If day of sysdate is sunday, I need to mask only 2 files

If day of sysdate is

not sunday

, I need to

mask 4 files

Eg: if Sunday, filemasks will be

"A10*","E05*","E08*","C25*"

<>Sunday,

filemasks will be "A10*","E05*"

We are stuck in production issue.

Any help would be really appreciated

Labels (2)
5 Replies
manodwhb
Champion II
Champion II

@Pavani Gudimetla​ , you use tjava component and take the current day and check it is Sunday or not Sunday and the store that value in one variable or global map and then take the run if and in the run if check that day is sunday one tfilelist and hard code your file mask fro sunday and for not sunday also take runif from tjava and connect another tfilelist and hard code your non sunday filemask.

 

Thanks,

Manohar

PavaniGudimetla
Contributor
Contributor
Author

But in this way I have to duplicate all components in my job,

I have around 20 components after file list,

Now I have to make them 40, 20 for sunday and 20 for non-sunday,

It would make my job bulky.

 

Is there any other way?

manodwhb
Champion II
Champion II

@Pavani Gudimetla​ ,the other way is like you need set filemask as context variables in tjava if Sunday ,to have two context variables and if not sunday also you should set those filemask context variables and call in tFileList.

 

Thanks,

Manohar

PavaniGudimetla
Contributor
Contributor
Author

Is there a way to set multiple filemasks in one context variable

or

Should we set one context variable for each filemask?

manodwhb
Champion II
Champion II

@Pavani Gudimetla​ , you need to set context variable for each filemask.