Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I cannot understand what's happening here, I wonder if some expert can shine a light on this thing.
I want to compare buyers of a quarter VS the previous one.
To get there I'm using Indirect Set Analysis with 2 AsOfMonth.Type: RQ (Rolling Quarter) and PRQ (Previuos Rolling Quarter)

With no selections this expression returns no results or always 0:
Sum({$< Account.ID =
p({$< AsOfMonth.Type = {'PRQ'} >} Account.ID) -
p({$< AsOfMonth.Type = {'RQ'} >} Account.ID) >}
Account.DCF)

while it works if I select a single month:

Here are the LOAD statements for who's willing to help me understand, thanks in advance for your support.
Account:
LOAD * INLINE [
Account.ID, Account.Name, Account.DCF
1, Company A, 1
2, Company B, 1
3, Company C, 1
];
Purchase:
LOAD * INLINE [
Account.ID, Date
1, 27/02/2015
2, 20/02/2015
2, 20/11/2014
3, 10/10/2014
];
Cal:
LOAD
TempDate AS Date,
MonthName(TempDate) AS Cal.MonthName;
LOAD
Date(mindate + IterNo()) AS TempDate
WHILE mindate + IterNo() <= maxdate;
LOAD
Min(Date) -1 AS mindate,
Max(Date) AS maxdate
RESIDENT Purchase;
AsOfMonth:
LOAD Cal.MonthName AS AsOfMonth.MonthName,
MonthName(AddMonths(Cal.MonthName, 1 - IterNo())) AS Cal.MonthName,
IF(IterNo() < 4, 'RQ', 'PRQ') AS AsOfMonth.Type
RESIDENT Cal
WHILE IterNo() <= 6;
So its working now? I was working on it right now and was not sure how I would do it. I am glad that you have figured it out. ![]()
Yes, I'm asked to work on a monthly basis so on the real app I'll need to round it up but the concept is working. ![]()
Thanks for helping me to understand Set Analysis could not work in this situation.
Not a problem my friend. I am glad I was able to guide you in the right direction.