Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

week number formuale issue

Hi Team,

   whats wrong with the below code.

'WEEK'& Week(If([WEEKNAME] = Right([WEEKNAME],2), '10', '4' OR '5', [WEEKNAME]),[WEEKNAME]) as [EXPECTED WEEK FORMAT]

Regards,

KK

stalwar1celambarasantushi0407israrkhanjagannallaNew to QlikView

KK
1 Solution

Accepted Solutions
MarcoWedel

not quite what you specified, but maybe helps nevertheless:

QlikCommunity_Thread_236237_Pic1.JPG

CALENDAR:

LOAD MONTH(DATE) as MONTH,

    WEEK(DATE) AS WEEK,

    Date(MonthStart(DATE),'MMM-YYYY') as CALENDAR_MONTH_ID,

    DATE AS DAY_DT,  

    WeekNAME(DATE,0,-1) AS WEEKNAME,

    WeekDay(DATE) AS WEEK_DAY,

    If(WeekDay(DATE) <> 'Sat' AND  WeekDay(DATE) <> 'Sun',DATE) AS WEEKEND,

    Year(DATE) as YEAR

    ;

LOAD Date(MakeDate(2014)+IterNo()-1) as DATE

AutoGenerate 1

While MakeDate(2014)+IterNo()-1<=Today();

LEFT JOIN

LOAD WEEKNAME,

    Date(Min(CALENDAR_MONTH_ID),'MMM-YYYY') as MinMonth,

    'Week'&AutoNumber(WEEKNAME,Max(CALENDAR_MONTH_ID)) as ALTERNATEWEEKFORMAT

Resident CALENDAR

Group By WEEKNAME

Order By WEEKNAME

regards

Marco

View solution in original post

6 Replies
sunny_talwar

What are you trying to do. Something is not right about this syntax? May be if you explain, we might be able to help you out here

Karim_Khan
Creator III
Creator III
Author

I want to show the entire years week number which starts from 1 to 53 should show in WEEK1,WEEK2,WEEK3,WEEK4,WEEK5 depending upon the month selection.

KK
rupamjyotidas
Specialist
Specialist

Doesn't this help?

'Week'&week(TempDate) As Week,

Karim_Khan
Creator III
Creator III
Author

I want all those week number in customize frmat i.e each week of evry month should fall into WEEK1,WEEK2,WEEK3,WEEK4,WEEK5 category

KK
MarcoWedel

Hi,

maybe helpful:

How to get the number of week per month?

AutoNumber(Week(Date),MonthName(Date)) as MonthWeek

QlikCommunity_Thread_211271_Pic1.JPG

regards

Marco

MarcoWedel

not quite what you specified, but maybe helps nevertheless:

QlikCommunity_Thread_236237_Pic1.JPG

CALENDAR:

LOAD MONTH(DATE) as MONTH,

    WEEK(DATE) AS WEEK,

    Date(MonthStart(DATE),'MMM-YYYY') as CALENDAR_MONTH_ID,

    DATE AS DAY_DT,  

    WeekNAME(DATE,0,-1) AS WEEKNAME,

    WeekDay(DATE) AS WEEK_DAY,

    If(WeekDay(DATE) <> 'Sat' AND  WeekDay(DATE) <> 'Sun',DATE) AS WEEKEND,

    Year(DATE) as YEAR

    ;

LOAD Date(MakeDate(2014)+IterNo()-1) as DATE

AutoGenerate 1

While MakeDate(2014)+IterNo()-1<=Today();

LEFT JOIN

LOAD WEEKNAME,

    Date(Min(CALENDAR_MONTH_ID),'MMM-YYYY') as MinMonth,

    'Week'&AutoNumber(WEEKNAME,Max(CALENDAR_MONTH_ID)) as ALTERNATEWEEKFORMAT

Resident CALENDAR

Group By WEEKNAME

Order By WEEKNAME

regards

Marco