Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

maximum of sum(sales) of a year

Hello Community,

this is my table

DateSales
01.01.20151000
01.07.20152000
01.09.20153000
01.01.20165000
01.04.20167000
01.01.20172000

how can I get

the biggest sum of sales per year?

QV should return me

12.000 € for the year 2016

I tried this expression. but it didnt work

=max(aggr(sum(Sales), year(Date)))

Could anyone help me out here?

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

Make sure to create Year field in Script like and Be aware of Date format of your environment

Year(Date) as Year

Then Set analysis, May be this

Sum({<Year = {'$(=Max(Year-1))'}>}Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

6 Replies
Anil_Babu_Samineni

Try this?

Make sure to create Year field in Script like and Be aware of Date format of your environment

Year(Date) as Year

Then Set analysis, May be this

Sum({<Year = {'$(=Max(Year-1))'}>}Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

tresesco
MVP
MVP

Create a Year field in the script like:

Load

          Year(Date) as Year

And then in the front-end try :  = max(aggr(sum(Sales), Year))

thanhphongle
Creator II
Creator II
Author

it works, thank you ! but is there another possibility without changing the script?

tresesco
MVP
MVP

If even possible (I doubt though), would not be an easy one. Creating a year/month field in the script is very common fact in BI, so I would not even try to find an alternative in the front-end.

c_gilbert
Creator II
Creator II

= max(aggr(sum(Sales), Year(Date)))

Ajaysantosh
Contributor
Contributor

your suggest expression don't work it's hide all table data so please show me the correct expression

thank you