Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weekly Sales

hi all,

please Find Attachment

am sending weekly Rolling Days calculation

Can any one modifies The Below Qvw File With more Efficient  Way

i have Done but don't think it efficient way of doing this

For Following task 

1)how to create Manual weeks??

i have 1-27 dates

i want

1-7 as first week

8-14 2nd week

15 -21 as 3 rd Week

22-27 as 4th week

in front end

2) and how to create Weekly Sales  for Comparison current Week vs previous week of the month

5 Replies
MK_QSL
MVP
MVP

You can use below script to get weeknumber as per your requirements.

Data:

LOAD S_Date,

     Sales

FROM

[New Microsoft Office Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1);

// ****************Creating the Master Calendar *************

Temp_Calendar_Range:

LOAD

  Date(Min([S_Date]), 'DD/MM/YY') as MinDate,

  Date(Max([S_Date]), 'DD/MM/YY') as MaxDate

RESIDENT [Data];

LET vMinDate = Num(Peek('MinDate', 0, 'Temp_Calendar_Range'));

LET vMaxDate = Num(Peek('MaxDate', 0, 'Temp_Calendar_Range'));

LET vToday =num(today());

DROP TABLE Temp_Calendar_Range;

DateField:

LOAD

  date ($(vMinDate) + rowno() -1) as TempDate

AUTOGENERATE

$(vMaxDate)- $(vMinDate)+1;

MasterCalendar:

LOAD

  TempDate as [S_Date],

  Day(TempDate) as Day,

  WeekDay (TempDate) as Weekday,

  Week(TempDate-1) as Week,

  Month(TempDate) as Month,

  Num(Month(TempDate)) as MonthNO,

  Year(TempDate) as Year,

  'Q' & ceil(month(TempDate) / 3) as Quarter,

  Date (monthstart (TempDate) , 'MMM YYYY') as MonthYear,

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

RESIDENT DateField

ORDER BY TempDate ASC;

DROP TABLE DateField;

MK_QSL
MVP
MVP

Please check enclosed file...

Not applicable
Author

Hi,

I hope this would help you in the dimension expression for ur chart.

=Pick(Num(Week(S_Date)),'W1','W2','W3','W4','W5')

Regards,

Venkat

Not applicable
Author

but in this when we click certain Date I doesn't Show comparison