Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Clerwyr
New Contributor

Total sales in a year and before

Hello (sorry for my english),

I made a formule which calculate Sales by PRG, Type and DAT_year.

But I want sales of PRG and Type of the year and previous years. For exemple in DAT_year 2016, i want total sales 2016+2015+2014+...

This formule works, but the year of reference is not variable (2016)... Thanks for your help !

sum(aggr(
Sum(total <PRG,Type> {<DateOperation={"<=$(=makedate(2016,12,31))"}>} Sales)
,PRG,Type,DAT_year))

4 Replies
sergio0592
Valued Contributor II

Re: Total sales in a year and before

Hi,

Try with :

sum(aggr(
Sum(total <PRG,Type> {<DateOperation={"<=$(=makedate(DAT_year,12,31))"}>} Sales)
,PRG,Type,DAT_year))
Clerwyr
New Contributor

Re: Total sales in a year and before

Hello Sergio,

It don't works. It give me the max DAT_year...

Highlighted
adequation_jna
New Contributor II

Re: Total sales in a year and before

Hello all,

I'm a colleague of "Clerwyr" , please find attached a POC (.qvf) to resume our issue.

 

 

Tags (2)
adequation_jna
New Contributor II

Re: Total sales in a year and before

POC_Formule_TauxEcoulement.png