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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate LMTD

Hi

       I want to Calculate Last Month till Date Sales. I have Selected 12 Oct -13 . I want to Calculate 01-Sep to 11-Sep-13.. Can u Please Suggest me the query

Labels (1)
5 Replies
Not applicable
Author

Try this one,

date={'>=monthstart(max(date),-1)<MakeDate(year(max(Date)),Month(Max(Date))-1,day(max(Date)))'}

Not applicable
Author

=Sum({<FinYear=,FinMonthName=,FinancialYear=,FinQuarter=, DateField={">=$(=Date(monthstart(vMaxDate,-1)))<=$(=Date(monthend(vMaxDate)))"}>}sales)

vMaxPrvDate=Date(max(CommonDateField),'DD/MM/YYYY')

salto
Specialist II
Specialist II

Hi,

maybe not the most elegant but I would try substracting the current month sales to to the total sales in the year, and then show the result:

=num(sum({<Year={$(=Max(Year))}> } SalesAmount))

-

num(sum({<Year={$(=Max(Year))}, MonthNum={$(=max(MonthNum)-1)} > } SalesAmount))

Hope this helps.

Not applicable
Author

Hi,

      Can U please explain the Expression. Because I have Date, Month , Year, Values Only

Not applicable
Author

I think this expression using set analysis will work :

sum( {< date={">=$(=monthstart(max({1}date),-1)) <$(=max({1}date))"} >} SALES)

we select the date for which to calculate the sum of sales.

Regards

Stéphane