Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got a syntax problem with set analysis in an expression:
In a chart I have the following fields:
I want to compare the sales of the year before and after the customer started to buy exclusively at my store (when he buys exclusively he gets discount).
For the expression I can use the field
This field contains the year before the startdate.... (for example: if Startdate = 1-1-2008 MinOneYearStartdate is 2007)
In the chart I use the following expression:
=Sum( {<Year={$(#=Only(MinOneYearStartdate))} >} Sales)
Somehow this does only work when I select one customer... When I have more customers selected it doesn't anymore... When I use:
=Sum( {<Year={$(#=Only(Year-1))} >} Sales)
The set analysis expression is working with multiple customers selected but I want the MinOneYearStartdate as value there of course.... can someone help me out? Thanks!
Hello, the problem is that your field MinOneYearStartdate is calculated I'm guessing for every customer, so when you apply the function only it will return null when more than one customer is selected, that's the reason of the behaviour you just explained. I think you can solve this problem by using a sum(if) instead of the set analysis.
Regards
Hello, the problem is that your field MinOneYearStartdate is calculated I'm guessing for every customer, so when you apply the function only it will return null when more than one customer is selected, that's the reason of the behaviour you just explained. I think you can solve this problem by using a sum(if) instead of the set analysis.
Regards
have similar problem
Assume variable "gender" with values "men" and "women"
Assume variable "age" associated with each record. Values can be "young" or "old"
In one bar chart with 4 bars, I want to compare count on "young men" with count on "all men" and count on "young women" with count on "all women"
I think the string ($<age>=) goes in there somewhere, but I can make this work.
Hey Bill, in your case that can be solved with set analysis your expression should look similar to this:
count({gender = {'men'}, age = {'young'}} PersonID)
You can modify the above to get your 4 expressions.
Regards
Thanks.. going to try with an if statement!