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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
panipat1990
Creator II
Creator II

How to calculate last month of maximum day

Dear Team,

Kindly help me for resolving this problem.How to calculate last month's Maximum day.

1 Solution

Accepted Solutions
sunny_talwar

For last month's max date sale, may be this:

Dimension

Month

Expression

FirstSortedValue(Aggr(Sum(Sales), TransactionDate), -TransactionDate)

View solution in original post

13 Replies
Vegar
MVP
MVP

There are several ways to do it, but this is one: MonthEnd(AddMonths( today() ,-1))

Cheers

Vegar

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Not applicable

Hi Gourav,

Can you please send any sample data.

sunny_talwar

To find day, may be add the Day() function and AddMonths can be avoided by passing -1 to MonthEnd:

=Day(MonthEnd(Today(), -1))

panipat1990
Creator II
Creator II
Author

Hi Sunny,

Suppose in my transaction's table  end of last month is 25/11/2016.Then how to calculate 25.

Because i am making rolling month calculation.and i show only maximum date of previous month.Suppose my in last month's Sale exist 3 days. 5 Nov,7 Nov, 10 Nov,..I want to show 10 Nov  sale on November month 

sunny_talwar

May be this:

Day(Max(TransactionDate))

sunny_talwar

For last month's max date sale, may be this:

Dimension

Month

Expression

FirstSortedValue(Aggr(Sum(Sales), TransactionDate), -TransactionDate)

panipat1990
Creator II
Creator II
Author

i used this for current month calculation. but when i used in Previous month calculation.then what i am use.

Like this For current.=Sum({$<Link_Date={"$(=vMaxDate)"}>} Sale)

When i make next expresion for Nov month Then what i  use.  Beause in Nov Month we have many date's value.And i Wnt only maximum day value.

sunny_talwar

Taking a step back, are you looking for two month information with Month as dimension?

panipat1990
Creator II
Creator II
Author

No, i understand the environemnt

My Dimension is store code like HB05,HB06,HB07

I have data last 15 month.

I am making straight table.

First expresion for current month Max day. Which is simple calculated max(Link_Date) and maxDay Variable.

But When i make second expression then What i use for maximum day. Beacuse in last month there are 4 to 5 days transaction and i want maximum day transaction.And When i will make 3 expression..Same Like 4 expresion