Discussion board where members can get started with Qlik Sense.
How can I make Qliksense recognize numbers and Year and Week.
I have a column contain below number:
201852 Year 2018 Week 52
Thus when I add 1 week into the number, it should become 201901.
I usually create a WeekStart field using the WeekStart() function:
WeekStart(MakeWeekDate( Left(MyYearWeekField,4), Right(MyYearWeekField,2))) as MyWeekStartField
Then to format it as the YearWeek number you can use the Dual function:
Dual(MyYearWeekField , WeekStart(MakeWeekDate( Left(MyYearWeekField,4), Right(MyYearWeekField,2)))) as MyWeekStartField
When you add 7 to a value of that field you get the next week since it's a date based field which has a unit of 1 day.
When i added 7 into the YearWeek,
It should return figure like 43570,43591 and etc.
How to return theses figure to 201901, 201902
Should or does? If it does then YearWeek is already a date field and you can use the Dual function to apply the formatting:
Dual( Year(YearWeek)*100+Week(YearWeek), YearWeek )