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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

Set Expression Month = {"<=$(=max(Month)-1)"} Does not return last month sales

Hi All

Below expression return current month sales correctly :-

Sum(Aggr(SUM({

<

year = {$(=only(year))},

Month = {"<=$(=max(Month))"},

rEVENUE={rEVENUE}

>

}Amount*1)/$(Columndim89)/1000, $(ColumnDim101)))

I modify the above exoression to get the last month revenue as below :-

Sum(Aggr(SUM({

<

year = {$(=only(year))},

Month = {"<=$(=max(Month)-1)"},

rEVENUE={rEVENUE}

>

}Amount*1)/$(Columndim89)/1000, $(ColumnDim101)))

I get null value , can some one advise me where i go wrong ?

Paul

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(Aggr(SUM({

<

year = {$(=only(year))},

Month = {"<=$(=max(Month)-1)"}, month, year,

rEVENUE={rEVENUE}

>

}Amount*1)/$(Columndim89)/1000, $(ColumnDim101)))

View solution in original post

3 Replies
paulyeo11
Master
Master
Author

my qv doc

sunny_talwar

Try this:

Sum(Aggr(SUM({

<

year = {$(=only(year))},

Month = {"<=$(=max(Month)-1)"}, month, year,

rEVENUE={rEVENUE}

>

}Amount*1)/$(Columndim89)/1000, $(ColumnDim101)))

paulyeo11
Master
Master
Author

Hi Sunny

Thank you very much for your advise again. But i try your expression return 3374 , how to make it display 947  ? Same as Table 2

Paul