Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have created following on script level, Now I would like to create WTD,MTD,YTD and LTD sales and units sold.
Sales:
load
*,
MonthName([Created DateTime]) as MonthYear,
Year([Created DateTime]) as Year,
Month([Created DateTime]) as Month,
Week([Created DateTime]) as Week,
WeekEnd([Created DateTime]) as Weekend,
WeekStart([Created DateTime]) as Weekstart,
MonthStart([Created DateTime]) as Monthstart,
MonthEnd([Created DateTime]) as Monthend,
QuarterName([Created DateTime]) as QuarterName,
Date([Created DateTime])as DateNum
;
sql
SELECT OrderNo
, ln.[Item No_]
,itm.[EAN]
,ln.[Category]
,ln.[Total Price]
,ln.[Quantity]
,ord.[Created DateTime]
,ofr.[Brand]
,[RRP]
FROM [Echo Trading$Order] ord
inner join [Echo Trading$Order Line] ln
on ord.No_=ln.[Order No_]
inner join [dbo].[Echo Trading$Offer] ofr
on ln.[Offer Id]=ofr.[Offer ID]
inner join
[dbo].[Echo Trading$Item] itm
on ln.[Item No_]=itm.[Item No_];
I would like to produce below table:
Brand | Item No | WTD units | WTD Sales | MTD Units | MTD Sales | YTD Units | YTD Sales | LTD Units | LTD Sales |
---|---|---|---|---|---|---|---|---|---|
Do I have to create any variables for calculation?
Thank you in advance.
Madhu
Hi Madhu,
Hope! Below post will give some idea for calculations.
https://community.qlik.com/docs/DOC-6163
Regards,
Kavi
Hi,
I have tried that ,but there is difference in sales WTD.
I have used sum(Total price) it gives £687 and when I use
Sum({<Year=, Month=, Quarter=, Week=, [Created DateTime]=, DateNum={">=$(=Num(WeekStart(Max(DateNum))))<=$(=Max(DateNum))"}>}[Total Price]) gives £571 exactly for that week and company started only last week. I would expect they should be same. And there are no sales for today.
Hi all,
Please check attached .qvw , WTD, MTD and YTD all showing same values. But data is there for 2 weeks. WTD and MTD must be different right. Please help.