Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis to show Sales between a Starting and a Ending date

I want to show Sales from a specific period (user can select two variables: start date and end date) using Set analysis. I have managed to do this for one day:

sum( {$< SalesDate = {'$(StartDay)'} >} Sales)

How to do for a period?

sum( {$< SalesDate >= {'$(StartDay)' and SalesDate <= {'$(EndDay)'} >} Sales). This is just an idea of what I need, of course this expression that I wrote doesn't work (and I can't make it work).

Thank you.

24 Replies
gandalfgray
Specialist II
Specialist II

@cherub_imp:

Do what?

Not applicable
Author

@ Goran : i got it..anyways thnks.

Not applicable
Author

Hi Goran,

Thanx for your reply, I'll try it the way you described with the script.

But isn't there no way at all in calculating intervals in a set expression?

Anyone?

Thanx,

Felix

johnw
Champion III
Champion III


Felix Hummel wrote:But isn't there no way at all in calculating intervals in a set expression?


Of course you can do it. This:

A-B >= C

Is mathematically equivalent to this:

A >= C+B

So you should be able to do something like this, though I suspect I have syntax problems:

sum({<DateofEntry={">=$(=date(AktDelayMin+Abgeschlossen)) <=$(date(AktDelayMax+Abgeschlossen))"}>} Totals)

Not applicable
Author

I was able to use the above expression to solve a similar problem. However, the numbers change from when I have everything selected to just a single selection and are only accurate with a single selection. Any insight as to what could be causing this? I have also isolated this issue to the greater than sign as the numbers do not change upon selection/de-selection when I change the greater than sign to an equal sign.