Announcements
[WEBINAR] Accenture & Qlik: Accelerating BI Migration to SaaS with Qlik on Dec 13th: REGISTER
cancel
Showing results for
Did you mean:
Creator II

## Calculation of sum of sales between range?

Hello Everybody,

I have a requirement where i need to to get sum(SalesNetPrice) between two month-year field ,

between Start_Year and End_Year.

i.e)Start_Year have values "Jan-2013" corresponding "End_Year"  have values "Dec-2013 ".

I need to calculate sum( SalesNetPrice) .with condition SalesDate_MonthYear in the range start_Year and End_yea

Currently am tried the below expression which is not working

Expression :

=Sum({<SalesDate_MonthYear={">=\$(StartYear) <=\$(EndYear)"}>} SalesNetPrice)

Priya

11 Replies
Not applicable

Hi,

Try This

=sum({<Date={"<=\$(=MonthName(YearStart(Date)))>=\$(=MonthName(Yearend(Date)))"},MonthYear=,Date= >}Sale)

Specialist

Hi,

*,

dual(date(Datefield, 'MMM-YYYY'), MonthEnd(Datefield)) as MonthYear,

From tablename;

Set the variable like

vStartYear = MonthStart(max(MonthYear),-9),

vEndYear = MonthEnd(max(MonthYear))

expression like this

Sum({<SalesDate_MonthYear={">=\$(StartYear) <=\$(EndYear)"}>} SalesNetPrice)

Note : your data available for oct-2013  only so max date is oct-2013. so only the put the condition like MonthStart(max(MonthYear),-9).

Hope its help,

regards,

Community Browser