Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator
Creator

Not able to get current month sales in my text object

Hi,

I do have the below data in my app.

Order DateSales
04-05-2020243.16
04-08-2020243.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

 

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

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)

View solution in original post

1 Reply
sunny_talwar

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)