Jorge Santos
New Member
- Joined
- Feb 2, 2012
- Messages
- 3
Hi, this might be a quite trivial question, but even after reading my entire book from Marco/Alberto F. I'm still struggling with the following.
Most of my tables look like this:
<style type="text/css">
table.tableizer-table {border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; font-size: 12px;} .tableizer-table td {padding: 4px; margin: 3px; border: 1px solid #ccc;}
.tableizer-table th {background-color: #104E8B; color: #FFF; font-weight: bold;}
</style>
<table class="tableizer-table" border=0 cellborder=0 cellpadding=0 >
<tr class="tableizer-firstrow" bgcolor=#8fbc8f><th>ProdCategory</th><th>User</th><th>Value</th></tr> <tr><td>A</td><td>John</td><td>428</td></tr> <tr><td>B</td><td>John</td><td>159</td></tr> <tr><td>C</td><td>Mary</td><td>284</td></tr> <tr><td>A</td><td>Mary</td><td>39</td></tr> <tr><td>B</td><td>Mary</td><td>28</td></tr> <tr><td>C</td><td>Mary</td><td>853</td></tr> <tr><td>A</td><td>James</td><td>486</td></tr> <tr><td>B</td><td>James</td><td>958</td></tr> <tr><td>C</td><td>Rick</td><td>827</td></tr> <tr><td>A</td><td>Patricia</td><td>346</td></tr> <tr><td>B</td><td>Patricia</td><td>651</td></tr> <tr><td>C</td><td>Patricia</td><td>734</td></tr> <tr><td>A</td><td>Julian</td><td>348</td></tr> <tr><td>B</td><td>Julian</td><td>316</td></tr></table>
Each user could have multiple value rows for different product categories. Now, I use a metric on my analysis that is the maximum value for the user (regardless of the ProdCategory). Let's call that metric MaxValue. What I need to get is the average MaxValue by ProdCategory. I am trying to do this as a Measure as i need to apply various filter context above this.
I'm sure this would be a very easy statement with 2 nested CALCULATE statement or something similar, but so far I have been doing it on SQL and just importing the results table.
Any guidance would be much appreciated. Thank you.
Most of my tables look like this:
<style type="text/css">
table.tableizer-table {border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; font-size: 12px;} .tableizer-table td {padding: 4px; margin: 3px; border: 1px solid #ccc;}
.tableizer-table th {background-color: #104E8B; color: #FFF; font-weight: bold;}
</style>
<table class="tableizer-table" border=0 cellborder=0 cellpadding=0 >
<tr class="tableizer-firstrow" bgcolor=#8fbc8f><th>ProdCategory</th><th>User</th><th>Value</th></tr> <tr><td>A</td><td>John</td><td>428</td></tr> <tr><td>B</td><td>John</td><td>159</td></tr> <tr><td>C</td><td>Mary</td><td>284</td></tr> <tr><td>A</td><td>Mary</td><td>39</td></tr> <tr><td>B</td><td>Mary</td><td>28</td></tr> <tr><td>C</td><td>Mary</td><td>853</td></tr> <tr><td>A</td><td>James</td><td>486</td></tr> <tr><td>B</td><td>James</td><td>958</td></tr> <tr><td>C</td><td>Rick</td><td>827</td></tr> <tr><td>A</td><td>Patricia</td><td>346</td></tr> <tr><td>B</td><td>Patricia</td><td>651</td></tr> <tr><td>C</td><td>Patricia</td><td>734</td></tr> <tr><td>A</td><td>Julian</td><td>348</td></tr> <tr><td>B</td><td>Julian</td><td>316</td></tr></table>
Each user could have multiple value rows for different product categories. Now, I use a metric on my analysis that is the maximum value for the user (regardless of the ProdCategory). Let's call that metric MaxValue. What I need to get is the average MaxValue by ProdCategory. I am trying to do this as a Measure as i need to apply various filter context above this.
I'm sure this would be a very easy statement with 2 nested CALCULATE statement or something similar, but so far I have been doing it on SQL and just importing the results table.
Any guidance would be much appreciated. Thank you.