Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm wondering how to make the sum of sales from 01.01 of a given year to "today".
so that the sum counts:
a) only after full months
b) after days
For example, today is April 26, so if the user selects the years 2022 and 2023, it should count:
a) January, February, March
b) from 01:01 to 26.04
My code counts the sum only for the range of years, please help, how can I improve it.
First year: Sum({<Year={"$(=(Max(Year)))"}>} Sales)
Second year: Sum({<Year={"$(=(Max(Year)-1))"}>} Sales)
Ok, I make it by Edit expression:
Sum({<MonthNbr={"$(= '=' & (Max(MonthNbr)))"}, Year={"$(=(Max(Year)))"}, Day={"$(= '<=' & (Max(Day)))"}, Data=>} sales)
Here I am giving an example for the similar issue i hope this expression will work
RangeSum(Above(
Sum({<[Ship Date] = {">=$(=Year([Ship Date]))"}, [Ship Date] = {"<=$(=Today())"}>} Sales),
0,
RowNo()
))
Please accept the solution if u liked it
Thx Prem0212 but somehow I got the error, can you send the qvf for analysis?
Ok, I make it by Edit expression:
Sum({<MonthNbr={"$(= '=' & (Max(MonthNbr)))"}, Year={"$(=(Max(Year)))"}, Day={"$(= '<=' & (Max(Day)))"}, Data=>} sales)