Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
See why Qlik is recognized as a Leader for the 10th year in a row – and discover how Qlik can help put your business in the lead. Get Report
Highlighted
Partner
Partner

Rolling based last three months average sale

Hello,

i want to sum 3 last month on one month

For jan. 2019 i want to sum 7+11+7+19, how i can do this ?

the set analysis is : Sum( {$<
FACT_Type = {"Mouvement"},
DateAnalyse={"<=$(=Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)))"}*{">=$(=addmonths(Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)),-3))"}>
} _Qte_consommee_local)

 Best regards,

Sophie

2019-01-09_12h11_50.jpg

1 Solution

Accepted Solutions
Highlighted

Re: Rolling based last three months average sale

May be you need one of these 2

RangeSum(Below(Sum({$<
FACT_Type = {"Mouvement"},
DateAnalyse={"<=$(=Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)))"}*{">=$(=addmonths(Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)),-3))"}>
} _Qte_consommee_local), 0, 4))

or this

RangeSum(Below(Sum({$<FACT_Type = {"Mouvement"}>} _Qte_consommee_local), 0, 4))

View solution in original post

3 Replies
Highlighted
albert_guito
Contributor II

Re: Rolling based last three months average sale

HI,

You don't need to intersect set analysis for this propousal

 Sum( {$<
FACT_Type = {"Mouvement"},
DateAnalyse={"<=$(=Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)))>=$(=addmonths(Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)),-3))"}>
} _Qte_consommee_local)
Ag+
Highlighted
Partner
Partner

Re: Rolling based last three months average sale

Hi,

Try these

=rangesum(above(Sum( {$<
FACT_Type = {"Mouvement"},
DateAnalyse={"<=$(=Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)))"}*{">=$(=addmonths(Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)),-3))"}>
} _Qte_consommee_local),0,3))

 

Regards

Mustaq

Highlighted

Re: Rolling based last three months average sale

May be you need one of these 2

RangeSum(Below(Sum({$<
FACT_Type = {"Mouvement"},
DateAnalyse={"<=$(=Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)))"}*{">=$(=addmonths(Date(Max({<FACT_Type={"Stock"}>} DateAnalyse)),-3))"}>
} _Qte_consommee_local), 0, 4))

or this

RangeSum(Below(Sum({$<FACT_Type = {"Mouvement"}>} _Qte_consommee_local), 0, 4))

View solution in original post