Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

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

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

Try this:

Sum(Aggr(SUM({

<

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

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

rEVENUE={rEVENUE}

>

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

3 Replies
paulyeo11
Valued Contributor II

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

my qv doc

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

Try this:

Sum(Aggr(SUM({

<

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

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

rEVENUE={rEVENUE}

>

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

paulyeo11
Valued Contributor II

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

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

Community Browser