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

Counting dates from weeks

Hi!

How can I create a loop and variables  to count the starting dates for the rest of the modules with this information:

Product Module Starting date Time Project Phase
Product 1 Design 5.1.2015 2 1
Product 1 Basic functions 4 2
Product 1 Optional upgrade 5 3
Product 1 Extra feature 1 8 4
Product 1 Extra feature 2 1 5
Product 1 Assembly 6 6
Product 1 Service package 1 2 7
Product 1 Service package 2 3 8
Product 1 Shipping 1 9
Product 1 Done 1 10

Time is number of weeks and the Project Phase tells the order in which the schedule is made. The modules can be all of these ten but also just some of them.

Any help with this would be highly appreciated!

Regards,

Heidi

2 Replies
anbu1984
Master III
Master III

Load *,Date(If(IsNull(StrtDt), Peek(StrtDtFin) + Previous(Time)*7,StrtDt)) As StrtDtFin;

Load Product,Module,Date#([Starting date],'DD.MM.YYYY')+0 As StrtDt,Time,[Project Phase] Inline [

Product,Module,Starting date,Time,Project Phase

Product 1,Design,5.1.2015,2,1

Product 1,Basic functions,,4,2

Product 1,Optional upgrade,,5,3

Product 1,Extra feature 1,,8,4

Product 1,Extra feature 2,,1,5

Product 1,Assembly,,6,6

Product 1,Service package 1,,2,7

Product 1,Service package 2,,3,8

Product 1,Shipping,,1,9

Product 1,Done,,1,10 ];

Not applicable
Author

Thank you Anbu!

It works in a way.

But is it possible with this type of code to have the end user make selections and changes through inputfields that would infect the dates? I want him to be able to (for example) change the Time field so that the Module one takes 4 weeks instead of 2 and this change would affect the starting dates of the modules coming after it.  Is it possible with this or should the script be more leveled?

Thanks for your help!