Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
s4ni9r
Contributor III
Contributor III

Splitting Year from YearWeek

Dear All,

I have YearWeek, which shows values as shown below, i want to separate this into two different columns.

1. Year  2. Month, Could you please help me , how to get Year seperatly and Month Speratley

 

WeekYear
2021-01
2021-02
 
2021-52
2021-53
Labels (1)
1 Solution

Accepted Solutions
6 Replies
NitinK7
Specialist
Specialist

try below

Subfield(YearWeek,'-',1) as Year

Subfield(YearWeek,'-',2) as Month

s4ni9r
Contributor III
Contributor III
Author

the second value after '-' is actually week, but i want in Year as seperate field and Month as seperte field using YearWeek as source field

PrashantSangle

Hello,

use makeweekdate() to convert you week into date and then from date you can easily get month & year

try like

Month(makeweekdate(left(WeekYear,4),right(weekYear,2))) as Month,

left(WeekYear,4) as Year,

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
s4ni9r
Contributor III
Contributor III
Author

ThankYou Very Much  Sir

PrashantSangle

if it work for you then like that solution and select accept as solution.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
s4ni9r
Contributor III
Contributor III
Author

Sure  Sir