Qlik Community

App Development

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

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
lakshmijanaki22
Contributor
Contributor

Sum of sales for current year if no selection made

Hi All,

I want my report to sum of max sales for each month in current year on opening for first time and on later year selections it should change accordingly. 

sum(aggr((max(sales)),Month)) This gives for all the years available.

Please help me with chart expression.

 

Thanks

Labels (1)
1 Reply
mhaferkamp
Partner
Partner

Hi Lakshmijanaki22,

the requirements for the formula are not quite clear for me, but try to give you an answers. In addition, it also depends on your data model.

I understand that you want calculate the highest order sales for the current maximum month.

If your facts are aggregated at order level, you can use something like following formula:

Max({<[OrderDate.Month]={$(=Month(Max([OrderDate.Date])))}, [OrderDate.Year]={$(=Year(Max([OrderDate.Date])))}>}Sales)

If your facts based on order detail level, you can use something like following formula:

Max(Aggr(Sum({<[OrderDate.Month]={$(=Month(Max([OrderDate.Date])))}, [OrderDate.Year]={$(=Year(Max([OrderDate.Date])))}>}Sales), OrderID))

I hope I was able to help you. Best regards,

Marius.