# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for
Did you mean: Not applicable

## Monthly Max Date's Sales

It seems simple, but I am missing something or doing it wrong. I have a chart with Months  as dimension and I need to show the monthly sales on the maximum date of the relative months. I am trying something like :

Sumt( {<Date = {' \$ (max(Date))'}> Sales}.   Can you tell me where I am doing it wrong?

Regards,

Amit

1 Solution

Accepted Solutions  MVP

Try

=FirstSortedValue( aggr(sum(Sales),Date), Aggr(-Date,Date))

16 Replies  Master

Hi Amit,

Try this Sum( {<Date = {\$ (=Date(max(Date)))}> Sales}

Rgds,

Sokkorn Not applicable
Author

you miss equal to sign.

Sum( {<Date = {' \$ (=max(Date))'}> Sales}

or try this

i think miss the format of date. write your date field inside Date() function.

Sum( {<Date = {' \$ (=date(max(Date)))'}> Sales} Not applicable
Author

Thanks both of you for your reply. I would request you to consider the dimension Month , because while I use the expression as in :

Sum( {<Date = {' \$ (=max(Date))'}> Sales} it gives me one sales amount for the maximum date for max month, i want one amount for each months. Please have a look.

Regards Not applicable
Author

SET vMaxYear=MAX(Year)

Sum({<Year={\$(vMaxYear)}, Date = {"\$(=Max({<Year={\$(vMaxYear)}>}Date))"}>} Sales)

Hope it will help u

regards-bika Not applicable
Author

Bika, It produces no difference, single value. Anyway, thanks for your try.  Specialist II

aggr(Sum( {<Date = {' \$ (=max(Date))'},year={"\$(=Max(Year))"}>} Sales),month) Not applicable
Author

No difference !   Specialist II

aggr(Sum( {<Date = {' \$(=only (max(Date)))'},year={"\$(=only(Max(Year)))"}>} Sales),month)

sum({\$<year={"\$(=Max(Year))"},month={"\$(=Max(Month))"},day={"\$(=Max(day))"}>}sales)

sum({\$<year={"\$(=Max(Year))"},month={"\$(=Max(Month))"},day={"\$(=Max(day))"}>}sales)

aggr( sum({\$<year={"\$(=Max(Year))"},month={"\$(=Max(Month))"},day={"\$(=Max(day))"}>}sales),month) Not applicable
Author

PFA and help. 