Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

New 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 (1)
1 Reply
New Contributor III

Re: Do While to create a custom week by customer

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...