Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Experts,
I have data with dates and sales . When i extract data into qlikview it shows in the 2nd week of this month.Iam using below expression for find Month_week.
if(month(weekend(Date))= month(Date),div(day(WeekEnd(Date)),7),div(day(Weekend(Date,-1)),7)+1)+1 as Month_Week;
Please give me a solution to solve this task and iam attaching one file .
Thanks in advanced,
suman.
Hi,
so you would divide months in weeks.
But when a month starts on saturday like Sep-18... Is the first week (one) an only 2days week?
Try this:
Tab:
load
year(Date)*100+week(Date) as Week,
date(Date) as Date,
Sales
FROM
[Book1 (1).xls]
(biff, embedded labels, table is Sheet1$);
Concatenate
load
year(min(Date-1))*100+week(min(Date)-1) as Week,
date(min(Date-1)) as Date,
0 as Sales
FROM
[Book1 (1).xls]
(biff, embedded labels, table is Sheet1$);
Tab2:
load*,
if(previous("Week")=Week, Previous("Week"), Previous(Week)+1) -
(year(Date)*100+Week(MonthStart(Date, 0)))+1 as month_week
resident Tab Order by Date;
drop table Tab;