Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead 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
swuehl
MVP
MVP

Try

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

View solution in original post

16 Replies
Sokkorn
Master
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.

nizamsha
Specialist II
Specialist II

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

Not applicable
Author

No difference !

nizamsha
Specialist II
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.

Thanks in advance.