on 09-25-2020 2:39 PM
Hi All,
I was wondering if somebody can assist me?
I'm trying to extract the week number from an object with a date format of YYYYWW (202001 - 202052) So basically the last 2 digits but I don't want the leading zeros for weeks 1 - 9. Also I would like it to be in a text format so I can merge with the rest of the weeks (Creating a new variable)
Is this possible?
Many thanks,
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayman,
Many thanks for your quick response!
I did try the formula you suggested but unfortunately it didn't work. I think its because the original date dimension (202001) is already a number that's why it gave me the below error. Ideally I would like the new week variable to be string, not sure if that's the correct way to do it but its worked in the past when merging the week numbers. Thanks for your help. Alex
Sorry, copying & pasting the image of my error doesn't appear to work either! Its says its an invalid data type.
If the [date] dimension is a number, convert it to a string:
DateS: ="" + [Date]
Then use [DateS] instead of [Date] in the formula
WW: =FormatNumber(ToNumber(Right([DateS]; 2)); "##")
...
and if you prefer WW to be a string then like before:
WW: ="" + FormatNumber(ToNumber(Right([DateS]; 2)); "##")
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.