Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Date formatting

Hello !

I think I remember that QlikView can formatting the date when we insert it from an excel file.

I have my date DD/MM/YYYY and I want to sort my data by day, month , year and week.

I know that for example if I want to sort by month I can write "date(monthstart(DATE),'MM/YYYY')"

But is it possible to count weeks (from 1 to 52) ?

Please help me ...

Annie

1 Solution

Accepted Solutions
MVP
MVP

Date formatting

Annie,

I think there is no format code for week number, but you could try this:

=dual(WeekYear(Date) & ' / W' & week(Date) ,Weekstart(Date))

Hope this helps,

Stefan

4 Replies
MVP
MVP

Date formatting

Annie,

I think there is no format code for week number, but you could try this:

=dual(WeekYear(Date) & ' / W' & week(Date) ,Weekstart(Date))

Hope this helps,

Stefan

Not applicable

Date formatting

Thank you it works !

I have a last question...

Actually I have my months like this : 01/2007 02/2007 ... 01/2008 02/2008

If I write this : "date(monthstart(Date),'MM/YYYY')", months are duplicate for the year.

Can I have only a list of month from 1 to 12 and clik on the year to have the right month.

MVP
MVP

Date formatting

Yes, use month(Date) to retrieve these values.

Month() will also return a dual, so I think you will get something like 'Dec' if you type in =month(today()) in a text box, but '12' if you use a num() around: num(month(today())) or num(month(Date)))

Regards,

Stefan

Not applicable

Date formatting

Thank you