Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
YAMAMO
Contributor
Contributor

Customer Sales less than a value (Year to date)

Dears,

Hope you are all good,

I am trying to get the Customer Sales which are less than a"3000" and year to date(depending on the month selected).

 Here is the expression tried :

sum({<Month={"<=$(=Max(Month))"},Year={$(v_MaxYear)},Customer={"=sum({<Customer= >} Sales)<3000"}>} Sales)

FYI : I get the correct results only when i select the months manually(for example : from Jan to Dec), how to achieve this by selecting only the month = December. 

Many Thanks,

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Customer = {"=Sum({<Customer, Month = {""<=$(=Max({<Year = {$(v_MaxYear)}>} Month))""}>} Sales) < 3000"}

View solution in original post

5 Replies
sunny_talwar

Try this

Sum({<Month = {"<=$(=Max({<Year = {$(v_MaxYear)}>} Month))"},Year = {$(v_MaxYear)}, Customer = {"=Sum({<Customer= >} Sales) < 3000"}>} Sales)
YAMAMO
Contributor
Contributor
Author

I tried it and I got the same result as the previous set analysis.

YAMAMO
Contributor
Contributor
Author

is it possible to include this : Month = {"<=$(=Max({<Year = {$(v_MaxYear)}>} Month))"}
Inside this : Customer = {"=Sum({<Customer= >} Sales) < 3000"} in order to have the result filtered with only selected YTD data for customers less than 3000.
YAMAMO
Contributor
Contributor
Author

Any feedback back please.
sunny_talwar

Try this

Customer = {"=Sum({<Customer, Month = {""<=$(=Max({<Year = {$(v_MaxYear)}>} Month))""}>} Sales) < 3000"}