Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
YAMAMO
New 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

Re: Customer Sales less than a value (Year to date)

Try this

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

Re: Customer Sales less than a value (Year to date)

Try this

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

Re: Customer Sales less than a value (Year to date)

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

YAMAMO
New Contributor

Re: Customer Sales less than a value (Year to date)

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
New Contributor

Re: Customer Sales less than a value (Year to date)

Any feedback back please.

Re: Customer Sales less than a value (Year to date)

Try this

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