Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the current sales from the beginning of the month until today?

So, let's say I have 3 selection boxs, one for the year, one for the month, and one for the day.

And I have this database:

Year     Month     Day     Sales

2013     6     4     150

2013     6     3     250

2013     6     2     200

2013     6     1     100

So, when I select Day 3, Month 6 and Year 2013, I want to see 550. And when I select Day 4, Month 6 and Year 2013, I want to see 700.

This is what I'm trying

Sum({$<Year= {$(#=Only(Year))}, Month= {$(#=Only(Month))}, Day= {'>=1 <=$(=Only(Day))'}>} Sales)

but i'm not having any luck. I get a 0.

Thanks in advance for the help community!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try sum({<Year={$(=only(Year))},Month={'$(=only(Month))'},Day={'<=$(=only(Day))'}>}Sales). Note the quotes for the Month search string.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
nizamsha
Specialist II
Specialist II

=sum({$<year={"$(=Max(Year))"},month={"<=$(=Max(Month))"},day={"<=$(=Max(Day))"}>}sales)

Gysbert_Wassenaar

Try sum({<Year={$(=only(Year))},Month={'$(=only(Month))'},Day={'<=$(=only(Day))'}>}Sales). Note the quotes for the Month search string.


talk is cheap, supply exceeds demand
Not applicable
Author

It's not working. I mean, I get a number at least now, but It's faaaaaaaaaar higher than my intended one

Not applicable
Author

It works now on our document! Thanks a million for your fast and awesome help!

nizamsha
Specialist II
Specialist II

=sum({<Year={$(=only(Year))},Month={'$(=only(Month))'},Day={'<=$(=only(Day))'}>}Sales)

=sum({<Year={$(=MAX(Year))},Month={'<=$(=MAX(Month))'},Day={'<=$(=MAX(Day))'}>}Sales)

=sum({<Year={$(=only(Year))},Month={'$(=MAX(Month))'},Day={'<=$(=MAX(Day))'}>}Sales)

in  LAST  2 expre u will get the correct output but u need to clck the year and day and month to see the correct output

but first expre u will get the excat one with out clicking. as gybert said

nizamsha
Specialist II
Specialist II

thanks gysbert i  am great follower of u

because of u i learned another new thing  today