Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ladybyrd2011
Contributor
Contributor

Do While to create a custom week by customer

I need to script a do while loop to create a week dimension that is based off when a customer signs a contract rather than the calendar week.  So, the Monday of the week they sign is week one then each week after will be week +1, +2 ...  I'm not sure how to script this to create the weeks.

Let vStartDate = ClientWeekStart;

Let vEndDate -= LastInvoiceWeekStart;

I would very much appreciate any suggestions.

Labels (2)
1 Reply
NhanNguyen
Contributor III
Contributor III

How do you want to store your week data? Do you need to update weekly how long since customers sign the contract or you simply need to update only 2 data points: weekstart and weekend?
Without any information, I think you can get week number by using week(). Please read more from qlik documentation: https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim...