Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
venkatbza
Creator
Creator

How to get quarter from week number

Hi Friends,

I have a year and week number combination field like(2019-1) from this I have to derive the Quarter column.

Data attached here, any suggestions please.

Year-WeekNo
2017-1
2017-2
2017-3
2017-4
2017-5
2017-6
2017-7
2017-8
2017-9
2017-10
2017-11
2017-12
2017-13
2017-14
2017-15
2017-16
2017-17
2017-18
2017-19
2017-20
2017-21
2017-22
2017-23
2017-24
2017-25
2017-26
2017-27
2017-28
2017-29
2017-30
2017-31
2017-32
2017-33
2017-34
2017-35
2017-36
2017-37
2017-38
2017-39
2017-40
2017-41
2017-42
2017-43
2017-44
2017-45
2017-46
2017-47
2017-48
2017-49
2017-50
2017-51
2017-52
2018-1
2018-2
2018-3
2018-4
2018-5
2018-6
2018-7
2018-8
2018-9
2018-10
2018-11
2018-12
2018-13
2018-14
2018-15
2018-16
2018-17
2018-18
2018-19
2018-20
2018-21
2018-22
2018-23
2018-24
2018-25
2018-26
2018-27
2018-28
2018-29
2018-30
2018-31
2018-32
2018-33
2018-34
2018-35
2018-36
2018-37
2018-38
2018-39
2018-40
2018-41
2018-42
2018-43
2018-44
2018-45
2018-46
2018-47
2018-48
2018-49
2018-50
2018-51
2018-52
2018-53
2019-1
2019-2
2019-3
2019-4
2019-5
2019-6
2019-7
2019-8
2019-9
2019-10
2019-11
2019-12
2019-13
2019-14
2019-15
2019-16
2019-17
2019-18
2019-19
2019-20
2019-21
2019-22
2019-23
2019-24
2019-25
2019-26
2019-27


Thanks,

Venkat

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

In order to define a quarter you need to know which day in the week is to define the quarter as a week can range over two different quarters. As an example the last week of July 2019 ends in August 2019 therefore ranging over two quarters.

 

I've done a solution for you in the attached qvw document. 

 

View solution in original post

2 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

You can build a calendar and connect it to you data, but I can see that you will have a problem as some weeks will be in two quarters. You'll need to come up  with the rule  to define which quarter a particular week should belong to.

How to build a calendar.

https://community.qlik.com/t5/QlikView-Documents/Calendars/ta-p/1496392

Regards,
Sergey
Vegar
MVP
MVP

In order to define a quarter you need to know which day in the week is to define the quarter as a week can range over two different quarters. As an example the last week of July 2019 ends in August 2019 therefore ranging over two quarters.

 

I've done a solution for you in the attached qvw document.