Thanks!!!

-Joel

On Fri, Jul 1, 2016 at 11:18 AM, hongbin ma <[email protected]> wrote:

> we don't have such plan yet. As a workaround you can create a hive view
> with an additional column for cnt * val, and use the view as fact table
> in your cube
>
> On Fri, Jul 1, 2016 at 1:06 PM, Joel Victor <[email protected]> wrote:
>
>> Hi,
>>
>> I have a fact table with two measure columns one is cnt and other is val
>> with count & sum measures defined over both columns. Val has either median
>> or average for that day.
>> Now if I want to calculate mean & median for a month I would be required
>> to do the following, sum(cnt * val) / sum(cnt).
>> I run the following query select sum(cnt * val) / sum(cnt) from
>> test_table where data_type=23 and event_date between '2016-04-01' AND
>> '2016-04-30';
>> I get a NullPointerException. Complete error attached to the mail.
>> I am guessing this is probably due it not being able to find a
>> realization that matches the sum(cnt * val) measure. If not is there
>> something else I am doing wrong ?
>> Usually when you try to query with a aggregation that is not a part of
>> the cube the error is that it can't find any realizations. But this query
>> just returns null.
>>
>> Are there any plans to support these kind of aggregates ?
>>
>> Thanks,
>> -Joel
>>
>
>
>
> --
> Regards,
>
> *Bin Mahone | 马洪宾*
>

Reply via email to