
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calculating Week numbers
I would like to define Week number based on invoice date, dependant on where the invoice date falls on the attached csv eg invoice date 28/12/2015 to be week 1
- Tags:
- new_to_qlikview

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to use Week() function of QlikView. Have you tried that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the response, unfortunately Im new to qlikview and not sure how to.
Thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try something like
Set DateFormat ='DD/MM/YYYY';
LOAD
[Start date],
[End Date],
Week([Start date]) as WeekNo
FROM ...;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, you don't want ISO week numbering, so Week() function won't work.
See
maybe using
SET vCal_RD = 1;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Do you want your Invoicedate falls within your Start date and End date? May be IntervalMatch() will helps.
Directory;
T1:
LOAD * INLINE [
InvoiceDate
12/28/2015
2/29/2016
3/21/2016
];
T2:
LOAD [Start date],
[End Date],
[Week No]
FROM
[Week Nos.xlsx]
(ooxml, embedded labels, table is [Week Nos]);
IntervalMatch(InvoiceDate) LOAD Distinct [Start date],[End Date] Resident T2;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set DateFormat ='DD/MM/YYYY';
LOAD
[Start date],
[End Date],
Week([Start date]) as WeekNo
FROM ...;
This loads ok, but how will dates be determined?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you looking for Weekstart() and Weekend() functions?
Like
LOAD Weekstart( [Invoice Date] ) as Weekstart,
Date(Floor( Weekend([Invoice Date]))) as Weekend,
Week( [Invoice Date] ) as WeekNo
FROM ...;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what I would like to do is be able to report my sales figures using week numbers as the csv.
Hope it makes sense.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have a fact table with sales figure and sales date, you can use a master calendar to create calendar fields from that:
If you need to redefine your week numbering from ISO to another numbering method, have a look at the code from Henric I posted in my previous answer.
