Qlik Community

Ask a Question

App Development

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

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sophie_bd
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
sunny_talwar

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
albert_guito
Creator II
Creator II

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+
MohammedMustaq
Partner
Partner

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

sunny_talwar

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