Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all!
I'm trying to make a table with comparison of sales for different periods. User should select one sale period first, and then table would show data for that period and same period from previous year.
Sale periods are in 'YYYY-MM-DD' format with DD = '01'.
I use variables below:
v_sf_MaxPeriod = date(max(saleperiod), 'YYYY-MM-DD')
v_sf_PriorYearDate = date(addyears(max(saleperiod),-1), 'YYYY-MM-DD')
I checked their values in text object, they're ok.
Expression (1) for selected period works correct:
SUM({<saleperiod={"=$(v_sf_MaxPeriod)"}>} sf_fact_count)
Same expression (2) for same period in previous year doesn't work:
SUM({<saleperiod={"=$(v_sf_PriorYearDate )"}>} sf_fact_count)
It returns same result as the previous one. But if I change expression (3) to:
SUM({<saleperiod={"<=$(=$(v_sf_PriorYearDate))>=$(=$(v_sf_PriorYearDate))"}>} sf_fact_count)
it works correct.
Why my expression (2) doesn't work? How to fix it?
Can you try one of these
Sum({<saleperiod = {"$(v_sf_PriorYearDate)"}>} sf_fact_count)
Removed = before $ in the above expression
Sum({<saleperiod = {"$(=$(v_sf_PriorYearDate))"}>} sf_fact_count)
Added $(...) in the above expression
Can you try one of these
Sum({<saleperiod = {"$(v_sf_PriorYearDate)"}>} sf_fact_count)
Removed = before $ in the above expression
Sum({<saleperiod = {"$(=$(v_sf_PriorYearDate))"}>} sf_fact_count)
Added $(...) in the above expression