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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting the 2 last months

Hey guys,

i trying to build a function which should select the last two months. With this function i am able to select the last month...

= Month(max({1}[Tatsächliche Einfahrt Datum]))

I want to activate this function when i switch to the next dokument...

Thank you

1 Solution

Accepted Solutions
sunny_talwar

May be this:

='(' & Month(max({1}[Tatsächliche Einfahrt Datum])) & '|' & Month(AddMonths(Max({1}[Tatsächliche Einfahrt Datum]), -1)) & ')'

View solution in original post

5 Replies
sunny_talwar

May be this:

='(' & Month(max({1}[Tatsächliche Einfahrt Datum])) & '|' & Month(AddMonths(Max({1}[Tatsächliche Einfahrt Datum]), -1)) & ')'

MK_QSL
MVP
MVP

=SUM({<InvoiceMonth=, InvoiceYear=, InvoiceQuarter=, InvoiceWeek=, InvoiceDate = {">=$(=MonthStart(Max({1}InvoiceDate),-1))<=$(=MonthEnd(Max({1}InvoiceDate)))"}>}Sales)

1) This will give you Total Sales for last two months.

2) I have bypassed InvoiceMonth,Year,Quarter, Week. So any selection made in those list box will not affect the end result.

Change InvoiceDate with [Tatsächliche Einfahrt Datum] and Sales with your respective fact data.

sunny_talwar

I thought he wanted Select in Field action expression . My bad

MK_QSL
MVP
MVP

Actually I also not understood what the question is... But just trying !

sunny_talwar

Hahahaha I guess between the two of us, we have got the base covered

Best,

Sunny