Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bvann040684
Partner - Contributor
Partner - Contributor

Set Analysis

I'm having some trouble setting up my set analysis expression.

I need to sum the Premium where there is and is not commission. The two expressions I'm using are:

Premium with Commissiohn ~     Sum ({$<[Invoice Line No] = {"= [Insurer Earn Commission] <> 0"}>}  Premium * InvLineExchRate)

Premium without Comm. ~     Sum ({$<[Invoice Line No] = {"= [Insurer Earn Commission] = 0"}>}  Premium * InvLineExchRate)

These work when a specific invoice has been selected but its rolled up into Office or Region all i get is zeros. If i change '[Invoice Line No]' to '[Invoice No]' it doesnt look at the individual lines anymore and just does a sum of the Invoice instead of each line. Since there can be muliple lines on each invoice each with or without commission I get the wrong numbers

Can anyone help me?

Inv Line #PremiumCommPrem w/ CommPrem w/o Comm
110510
22020
330530
44040
550550
Total150159060
4 Replies
Not applicable

If your filter you want to add is based on the "commission" status, why do you use the "invoice line no" dimension in your Set Analysis ?

Sum of "Premium" having commission :

[code]

=sum({$ <[Insurer Earn Commission]={'<>0'}>} Premium)

[/code]

Sum of "Premium" having no commission :

[code]

=sum({$ <[Insurer Earn Commission]={'0'}>} Premium)

[/code]

Not applicable

Well first of all I don't really understand your set analysis as I think it should be what nmartin above said (except I would use -={0} instead but I don't think it matters).

You say it works when you select one invoice but that is the only time it works which makes me think your problem is that set analysis is calculated once per chart, not once per row.  I don't really understand your data so I don't know for sure that is probably the problem.  You probably need to use the aggr function which often isn't the most fun thing in the world.

bvann040684
Partner - Contributor
Partner - Contributor
Author

Neither answer worked.

I originally added Invoice No and Invoice Line No because the Commission was by line in each invoice so I needed a line by line answer.

I updated the orinigal question with a chart that might explain it better.

Not applicable

Bvann040684 a écrit:

Neither answer worked.

I've tested with what I said earlier, just replacing the "0" by a empty string value when there is no Comm (I thought "no comm" was "comm = 0"):

[code]

LOAD * INLINE [

Inv Line #, Premium, Comm

1, 10, 5

2, 20,

3, 30, 5

4, 40,

5, 50, 5

];

[/code]

Expressions:

[code]

=sum({$ <[Comm]={'<>0'}>} Premium)

or

=sum({$ <[Comm]-={''}>} Premium)

[/code]

and

[code]

=sum({$ <[Comm]={''}>} Premium)

[/code]

And I have the following result:

2011-05-11_170555.png

Is you don't want to use set analysis, you can use simple conditions :

[code]

=sum(if([Comm] <> '', Premium))

and

=sum(if([Comm] = '', Premium))

[/code]