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

Creating tables using Set Analysis

Hi All!

Id like a help from you guys with set analysis commands. Id like to create a new table by using set analysis and then sum the values on one field.

I have now the following table:

MonthProductChanelConsider?Expectation
11A10,5
21A11
12A00,4
22B10,3
13A11
14B10,4

What I want to do is to create a new table from this one where the value on "Consider?" field is equal to 1 and where the "Product" field would contain only distinct products. After all, Id like to sum the values on the "Expectation" field.

So the new table would be like (the key would be "Month-Product"):

MonthProductExpectation
110,5
220,4
131
140,4
211

In the end, id like to sum the expectation, then the final result would be 3,3.

Does anyone know how to do that?

Regards

6 Replies
sunny_talwar

I think Month 2 Product 2 has an expectation of 0,3 and not 0,4.

where the "Product" field would contain only distinct products.

I don't understand this part, but may be try this:

Sum({<[Consider?] = {1}>}Expectation)

Anonymous
Not applicable
Author

Hey Sunny, tls for the answer!

But please note that the Chanel should not be taken into account for the calculation.

So, if we have the same product with more than one chanel in one month, we will only consider it once (it will always have the same expectation in that case).

Is it clearer now for you?

Tks!

sunny_talwar

May be this:

Sum({<[Consider?] = {1}>} Aggr(Sum(DISTINCT {<[Consider?] = {1}>}Expectation), Month, Product))

Anonymous
Not applicable
Author

Hey Sunny, tks again, but still didnt work

Sorry to take so much of your time. I manipulated the database somehow to simplify it.

What I got now i that:

ID     EXPECTATION

1             1

1             1

2             1

2             1

3             0,5

3            0,5

The outcome of this would be 2,5 (1 - 1/ 2 - 1 / 3 - 0,5)

Have you got any ideia of how i can make it?

Tks again!

sunny_talwar

Should be just this

Sum(Aggr(Sum(DISTINCT EXPECTATION), ID))

or

Sum(Aggr(Avg(EXPECTATION), ID))

or

Sum(Aggr(Min(EXPECTATION), ID))

or

Sum(Aggr(Max(EXPECTATION), ID))


Anonymous
Not applicable
Author

Worked! Tks so much!