Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
need help with set analysis. I have a yearmonth field - StatusHistory.YearMonth
i need to count sabid for curent month and previous month..
for curent month i count :COUNT (distinct SabID)
its works
for previous month i count: COUNT({<StatusHistory.YearMonth = {"$(=StatusHistory.YearMonth(Max(StatusHistory.YearMonth), -1))"}>}distinct SabID)
but is not working
Try this
COUNT({<StatusHistory.YearMonth = {"$(=Max(StatusHistory.YearMonth), -1)"}>}distinct SabID)
Better create a date using monthyear data available, then you can easily add a flag for current & previous month, year etc.
not working..
Could you provide your example?
Hi,
In your Master Calendar if there is no year & month then create these two,
Load
MakeDate(Left(StatusHistory.YearMonth, 4), Right(StatusHistory.YearMonth,3)) AS Date,
Left(StatusHistory.YearMonth, 4) AS Year,
Num(Right(StatusHistory.YearMonth,3)) As Month
......
Then try this expression:
Count({<Year = {'$(=Max(Year))'}, Month={'$(=Max(Month))'}>} Distinct SabID) ---- Current Month
Count({<Year = {'$(=Max(Year))'}, Month={'$(=Max(Month) - 1)'}>} Distinct SabID) ---- Previous Month
Hope it helps.
thanks all for replayes, i cant sent a example becouse its very huge (500mb), ist complicate to explain, but i have a master caledar, but i can use ir for his expresion, becouse its coresponds for abonement sales date..i need count all active abonemens for each month, and for this i have field StatusHistory.YearMonth. Waht exacly i need:
i need on straight table have 2 expresions, one - active abonements on month start(i already have it with - COUNT (distinct SabID), second - active abonement on month end (for this i want to get values from next month, , becouse the values of next monthstart active abonemets ant curentmonthend is similar.