Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
lalitkgehlot89
Creator II
Creator II

Need front end logic help to calculate best month & best week Sale in text box object.

Hi,

from given data I want to show best week and best month sale in text object.

Please help me to calculate it.

3 Replies
sdmech81
Specialist
Specialist

Hi,

For max values based on month you can say:

=Max(Aggr(SUm(AMOUNT),Month))

for that month name:

=FirstSortedValue(Month,-Aggr(SUm(AMOUNT),Month))

Similarly try for Week

You can refer attachment..If this is nt wt u want plss state it again..But hope ths gives u max value sorted based on month n I understood coreectly

Sachin

sdmech81
Specialist
Specialist

Plss try similarly fr WEEK..

Sachin

lalitkgehlot89
Creator II
Creator II
Author

Hi Sachin,

Thanks a lot, given logic is working.

but i want to show it with YTD Sales.

I have written the expression for YTD value:-


=Max(Aggr(SUm({<Month=,Year=,DATE={">=$(YTDStartDate)  <=$(YTDEndDate)"}>}AMOUNT),Month))

YTDStartDate:- YearStart(max(DATE))

YTDEndDate:- max(DATE)

it is working properly with out any selection Or Year Selection also.

But in the case of Month selection it is showing that month sales value and that month name.

My Required output is In Year 2016 Jul is the best month.

If i select year 2016 then Jul month and Jul Month Sales value should be show.

and if i select the month Oct of year 2016 should be show best month name and sales vales. with this data that is Jul again.