Discussion Board for collaboration related to QlikView App Development.
Hi,
I do have the below data in my app.
Order Date | Sales |
04-05-2020 | 243.16 |
04-08-2020 | 243.16 |
And i use master calendar to get the month from 'Order Date' Column
Load
TempDate AS [Order Date],
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
num(Month(TempDate)) AS MonthNum,
Day(TempDate) As Day,
YeartoDate(TempDate)*-1 as CurYTDFlag,
YeartoDate(TempDate,-1)*-1 as LastYTDFlag,
inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12,
date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,
ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay,
Date(AddYears(TempDate, 1)) as Date,
Date(Date#(TempDate, 'YYYYMMDD')) AS Full_Date_Format
And i use the below set analysis to get the current month and current month-3 sales but it is showing zero.
=Sum({<Month={"$(=Max(Month))"}>} Sales) -- Current Month Sales
=Sum({<Month={"$(=Max(Month)-3)"}>} Sales) -- Month-3 sales (i.e. May Sales)
But the text boxes are displaying Zeros but it has to be '243.16'. Can some one help me to correct my code.
Regards,
Bharath Vikas
Since you have a MonthNum field, why don't you try using that instead
=Sum({<MonthNum = {"$(=Max(MonthNum))"}>} Sales) -- Current Month Sales
=Sum({<MonthNum = {"$(=Max(MonthNum)-3)"}>} Sales) -- Month-3 sales (i.e. May Sales)
Since you have a MonthNum field, why don't you try using that instead
=Sum({<MonthNum = {"$(=Max(MonthNum))"}>} Sales) -- Current Month Sales
=Sum({<MonthNum = {"$(=Max(MonthNum)-3)"}>} Sales) -- Month-3 sales (i.e. May Sales)