Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 211 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Complex Distinct Sum

Hi guys.
I have a table with the following fields/values:
SK_TIME | SK_CAMPUS | SK_CLASS | SK_QUESTION | QTT_NOTE1 | QTT_ANSWERS | ID_ANSWERS_CLASS | |
---|---|---|---|---|---|---|---|
2017010100 | 40 | 340 | 1 | 2 | 19 | 19340 | |
2017010100 | 40 | 340 | 2 | 1 | 19 | 19340 | |
2017010100 | 40 | 340 | 3 | 6 | 19 | 19340 | |
2017010100 | 40 | 340 | 4 | 5 | 19 | 19340 | |
2017010100 | 40 | 1235 | 1 | 7 | 13 | 131235 | |
2017010100 | 40 | 1235 | 2 | 8 | 13 | 131235 | |
2017010100 | 40 | 1235 | 3 | 5 | 13 | 131235 | |
2017010100 | 40 | 299 | 1 | 6 | 9 | 9299 | |
2017010100 | 40 | 299 | 2 | 2 | 9 | 9299 | |
2017010100 | 40 | 299 | 3 | 7 | 9 | 9299 | |
2017010100 | 40 | 22322 | 1 | 3 | 17 | 1722322 | |
2017010100 | 40 | 22322 | 2 | 5 | 17 | 1722322 | |
2017010100 | 40 | 22322 | 3 | 8 | 17 | 1722322 | |
2017010100 | 40 | 19203 | 4 | 1 | 8 | 819203 | |
2017010100 | 40 | 19681 | 5 | 10 | 4 | 419681 |
* Note that ID_ANSWERS_CLASS is a join of QTT_ANSWERS + SK_CLASS
And I need to do a analysis that returns something like this:
SK_CAMPUS | SK_QUESTION | % OF NOTE | TOTAL_ANSWERS |
---|---|---|---|
40 | 1 | 25,7% | 70 |
40 | 2 | 22,8% | 70 |
40 | 3 | 37,1% | 70 |
40 | 4 | 8,6% | 70 |
40 | 5 | 1,4% | 70 |
Where TOTAL_ANSWERS is:
SUM of ALL DISTINCT QTT_ANSWERS by ID_ANSWERS_CLASS.
And % OF NOTE is:
(SUM of all QTT_NOTE1 by SK_QUESTION * 100) / TOTAL_ANSWERS.
Any clue of how to solve this problem?
Regards.
Luiz Araujo
Answers
-
Does sum(distinct qtt_answers by ID_ANSWERS_CLASS) not work for you as the basis of the first calculation?
And
sum(qtt_note1 by sk_question) / sum(distinct qtt_answers by ID_ANSWERS_CLASS)
For the second.
Note also, you may have to include the elements you are "summing by" in answers, just exclude / hide them in the presentation.
If this does not work then I would try pushing the calcs into the rpd for the sum distinct element, as with OBIEE the tricky part tends to be working around the fact that it tries to aggregate as early as possible, and this can sometime yield spurious results, though I have used parallel logic to what you describe to create dynamic population based share of market / share of segment style functionality which is semantically identical to what you are trying to do.
0 -
Hi Luiz,
I need one help here...in your given table, how to do the calculation in DV to get the column ID_ANSWERS_CLASS.?? Thank you
0