Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weekname format

Let say I have Weekname('2011-06-21') which return 2011/25, but behind it is the date of 20/06/2011 (first day of the week).

Now, I need the date of the first day of the same week in 2010 (ie. 2010/25). What would be the simplest solution.

I can't use AddMonths(Weekname('2011-06-21'),-12), as it won't be accurate

Is there such function Date#('2010/25','YYYY/WW')?

The display of '2011/25' must follow a certain format, if behind it stores numeric value. But which format is it?

Thanks in advance for your help

1 Solution

Accepted Solutions
Not applicable
Author

Hi Allano.

Hope this help

You can use this fuction to create the LY date:

MakeWeekDate( YYYY [ , WW [ , D ] ] )

Returns a date calculated from the year YYYY, the week WW and the day-of-week D.

If no day-of-week is stated, 0 (Monday) is assumed.

Examples:

makeweekdate( 1999,6,6 )

returns

1999-02-14

makeweekdate( 1999,6 )

returns

1999-02-08

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hi,

What about

WeekName(AddYears('21/06/2011', -1))

Is this what you are looking for?

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hi Allano.

Hope this help

You can use this fuction to create the LY date:

MakeWeekDate( YYYY [ , WW [ , D ] ] )

Returns a date calculated from the year YYYY, the week WW and the day-of-week D.

If no day-of-week is stated, 0 (Monday) is assumed.

Examples:

makeweekdate( 1999,6,6 )

returns

1999-02-14

makeweekdate( 1999,6 )

returns

1999-02-08

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes there is a Date#() function.

    But i m not sure in which format it stores it, Date or number.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nagaiank
Specialist III
Specialist III

Please see if the expressions in the attached qvw file for the various expressions that may give the results you want.

Hope this helps.