Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
qw_jakub
Partner
Partner

Week-Year in Date format

Hello,

is there a way to format a date field as WeekNumber-Year (1-2013,2-2013, ..., 53-2013) similar to: 

date(monthstart(TempDate), 'MMM-YYYY') as [Month-Year]

?

I can do it as

Week(TempDate) & '-' & Year(TempDate)

but this will not be understood as a date represantaion a will not sort accordingly.

Thanks for any suggestions!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try weekname() function.

View solution in original post

4 Replies
tresesco
MVP
MVP

Try weekname() function.

qw_jakub
Partner
Partner
Author

Thanks,

this is simple and good sollution. Is there a way to reformat it from '2013/52' to: '52-2013' ?

jvishnuram
Partner
Partner

Hi Jakub,

Try this,

DATE:

Load Max(Date) as MAX_DATE,

Min(Date) as MIN_DATE

from Table_Name;

Let vMinDate = Peek('MIN_DATE',0,'DATE');


in the calendar use this.,

Num(Week($(vMinDate) + IterNo() - 1), '00')&'-'&Num(Year($(vMinDate) + IterNo() - 1)) as EXPEXTED

tresesco
MVP
MVP

I guess there is no system date format for the same. You can consider (in the front end) changing the representation using string functions.