Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SetAnalysis with P statement

Hi guys,

I need you help in problem related with Set Analysis. For expression 'Capital' I would like calculate sum of Values in this column where FlagF=FlagC. When I choose selection Payment_Outlay_Period it works correctly, but when deselect it, then it shows incorrect value (for 2012.01 capital must be 3000 insted of 26570). Who can help me and describe this problem?

I guess it is related with o in   %CaseIDKey = p({$<FlagC={1}>} may be it returns %CaseIDKey values from all data set despite on concrete Payment_Outlay_Period. If yes, what I should add in this P statement. Thanks for any help.

4 Replies
Not applicable
Author

Why not aggregate your source data it would make this much easier to handle?

Not applicable
Author

This sample is very very little peace of whole report and I haven't possibility to aggregate something more in script

chematos
Specialist II
Specialist II

In your data FlagC and FlagF are not equals in all the rows, the sum must be 0

Look if you use this the result is 0 because I`ve said above:

sum({<FlagF = {"=FlagC"}>} Collections_Fees_LC)

If you use this to sum the distincts:

sum({<FlagF -= {"=FlagC"}>} Collections_Fees_LC)

the result is 179043

I don´t know what's the meaning of that 3000 with that filters....

May be there is something missing

Not applicable
Author

Collections_Fees_LC column contains two type of records 1. Colletions with FlagC=1 and 2. Fees with FlagF=1.

Expression [Nr of payers] contains count of collections by each period, expression [Payments] contains sum of payments for these payers(%CaseIDKey) by each period, and the purpose is to get the sum of Fees for these payers by each period.

The problem is in P statement  %CaseIDKey = p({$<FlagC={1}>}  because it takes all %CaseIDKey ignoring periods, but I need only from each period. Who knows what and how I should add some additional condition?