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: 
Anonymous
Not applicable

How to achive from one Date to multiple dates

0683p000009Lu7I.pngsource0683p000009Lu1v.pngtarget

By using this source file how to get multiple dates in order

 

Labels (3)
6 Replies
TRF
Champion II
Champion II

Using TalendDate routines (https://help.talend.com/display/TalendOpenStudioforBigDataUserGuide520EN/10.5+TalendDate+Routines) compute the difference between start and end date, then tLoop from 1 to nb_days, add i to start date giving current date. You got what you need for your job.
Anonymous
Not applicable
Author

Can you please help me.I tried with tjava and tloop but not able to do

Anonymous
Not applicable
Author

This is actually a bit tricky.

 

  

I did some rough work and came up with this solution. Hope it gives you some idea.

 

You have to first calculate the difference between the start date and end date and store it in a context value.

Then for each row, you have to use the tLoop component to generate the missing dates.

 

The layout of the job,

0683p000009LuQ1.png

tMap12 Config,

0683p000009LuNC.png

 

tJava Code,

 

0683p000009LuQU.png

 

tLoop Config,

0683p000009LuOA.png

tFixedFlow Component Config,

0683p000009Lu4k.png

 

 

 

tMap13 config,

0683p000009LuM5.png

Here we have two contexts created. One is the context Loop of integer datatype for storing the max loop number.

Other one is the context startDate of datatype date for storing the starting date.

Remember to check the append option if your output is a file.

 

There might be a better way to do this. Hopefully this template gets you started on what you want.

 

 

 

 

Anonymous
Not applicable
Author

thank u very much i will try and let u know

TRF
Champion II
Champion II

Hi,

Thanks to @ArvinRapt to have detailed the solution I proposed.

I don't think it's too much tricky.

Maybe you can change tJava by tSetGlobalVar and use global variables instead of context variables, but it's a detail.

Also I think you can move the operation made in the tMap into the tFixedFlowInput component to comple the startDate field.

 

Regards,

Anonymous
Not applicable
Author

@TRF Agreed. Those two suggestions make the job easier on the eyes.