You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by 耳东 <77...@qq.com> on 2016/04/26 14:56:52 UTC

how to get the rate value

Hi all:


      I want to get a value which is defined as sum(a)/sum(b), how can I do this kind of anlysis.
     
      Now I build a cube which have sum(a) and sum(b), when I execute “select sum(a)/sum(b) from table1 group by c” ,the result is wrong. sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.


         MMENE_NAME    SUCC   ATT    SUCC/ATT  
     CSMME15BZX   336981   368366   1  
     CSMME32BZX   338754   366842   1  
     CSMME07BZX   687965   747694   1  
     CSMME03BHW   703269   747623   1  
     CSMME12BZX   705856   764656   1  
     CSMME16BHW   1962293    142173   1  


       MMENE_NAME   SUCC   ATT   ATT/SUCC  
     CSMME15BZX   336981   368366   0  
     CSMME32BZX   338754   366842   0  
     CSMME07BZX   687965   747694   0  
     CSMME03BHW   703269   747623   0  
     CSMME12BZX   705856   764656   0  
     CSMME16BHW   1962293    142173   0

Re: how to get the rate value

Posted by hongbin ma <ma...@apache.org>.
​I think it's still worth a JIRA:
https://issues.apache.org/jira/browse/KYLIN-1690

On Sun, May 15, 2016 at 11:43 PM, hongbin ma <ma...@apache.org> wrote:

> for integer metrics, a quick workaround is to modify sum(b)/sum(a)  to
> 1.0*sum(b)/sum(a)
>
> On Sun, May 8, 2016 at 8:26 PM, Li Yang <li...@apache.org> wrote:
>
>> Thanks for the update.
>>
>> On Thu, May 5, 2016 at 2:57 PM, 耳东 <77...@qq.com> wrote:
>>
>> > The datatype is bigint. This problem is solved, when I change to double.
>> >
>> >
>> > ------------------ 原始邮件 ------------------
>> > 发件人: "耳东";<77...@qq.com>;
>> > 发送时间: 2016年4月27日(星期三) 下午5:46
>> > 收件人: "dev"<de...@kylin.apache.org>;
>> >
>> > 主题: 回复: how to get the rate value
>> >
>> >
>> >
>> > the Kylin version is added in the description.
>> >
>> >
>> >
>> >
>> > ------------------ 原始邮件 ------------------
>> > 发件人: "Li Yang";<li...@apache.org>;
>> > 发送时间: 2016年4月27日(星期三) 下午5:07
>> > 收件人: "dev"<de...@kylin.apache.org>;
>> >
>> > 主题: Re: how to get the rate value
>> >
>> >
>> >
>> > Please provide the Kylin version in the JIRA.
>> >
>> > On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
>> > wrote:
>> >
>> > > hi dong, could you please open a JIRA to Kylin for tracking this
>> issue?
>> > > https://issues.apache.org/jira/secure/Dashboard.jspa
>> > >
>> > > Thanks!
>> > >
>> > > 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
>> > >
>> > > > Hi all:
>> > > >
>> > > >
>> > > >       I want to get a value which is defined as sum(a)/sum(b), how
>> can
>> > I
>> > > > do this kind of anlysis.
>> > > >
>> > > >       Now I build a cube which have sum(a) and sum(b), when I
>> execute
>> > > > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
>> > > > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
>> > > >
>> > > >
>> > > >          MMENE_NAME    SUCC   ATT    SUCC/ATT
>> > > >      CSMME15BZX   336981   368366   1
>> > > >      CSMME32BZX   338754   366842   1
>> > > >      CSMME07BZX   687965   747694   1
>> > > >      CSMME03BHW   703269   747623   1
>> > > >      CSMME12BZX   705856   764656   1
>> > > >      CSMME16BHW   1962293    142173   1
>> > > >
>> > > >
>> > > >        MMENE_NAME   SUCC   ATT   ATT/SUCC
>> > > >      CSMME15BZX   336981   368366   0
>> > > >      CSMME32BZX   338754   366842   0
>> > > >      CSMME07BZX   687965   747694   0
>> > > >      CSMME03BHW   703269   747623   0
>> > > >      CSMME12BZX   705856   764656   0
>> > > >      CSMME16BHW   1962293    142173   0
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > Best regards,
>> > >
>> > > Shaofeng Shi
>> > >
>>
>
>
>
> --
> Regards,
>
> *Bin Mahone | 马洪宾*
> Apache Kylin: http://kylin.io
> Github: https://github.com/binmahone
>



-- 
Regards,

*Bin Mahone | 马洪宾*
Apache Kylin: http://kylin.io
Github: https://github.com/binmahone

Re: how to get the rate value

Posted by hongbin ma <ma...@apache.org>.
for integer metrics, a quick workaround is to modify sum(b)/sum(a)  to 1.0*
sum(b)/sum(a)

On Sun, May 8, 2016 at 8:26 PM, Li Yang <li...@apache.org> wrote:

> Thanks for the update.
>
> On Thu, May 5, 2016 at 2:57 PM, 耳东 <77...@qq.com> wrote:
>
> > The datatype is bigint. This problem is solved, when I change to double.
> >
> >
> > ------------------ 原始邮件 ------------------
> > 发件人: "耳东";<77...@qq.com>;
> > 发送时间: 2016年4月27日(星期三) 下午5:46
> > 收件人: "dev"<de...@kylin.apache.org>;
> >
> > 主题: 回复: how to get the rate value
> >
> >
> >
> > the Kylin version is added in the description.
> >
> >
> >
> >
> > ------------------ 原始邮件 ------------------
> > 发件人: "Li Yang";<li...@apache.org>;
> > 发送时间: 2016年4月27日(星期三) 下午5:07
> > 收件人: "dev"<de...@kylin.apache.org>;
> >
> > 主题: Re: how to get the rate value
> >
> >
> >
> > Please provide the Kylin version in the JIRA.
> >
> > On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
> > wrote:
> >
> > > hi dong, could you please open a JIRA to Kylin for tracking this issue?
> > > https://issues.apache.org/jira/secure/Dashboard.jspa
> > >
> > > Thanks!
> > >
> > > 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
> > >
> > > > Hi all:
> > > >
> > > >
> > > >       I want to get a value which is defined as sum(a)/sum(b), how
> can
> > I
> > > > do this kind of anlysis.
> > > >
> > > >       Now I build a cube which have sum(a) and sum(b), when I execute
> > > > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> > > > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
> > > >
> > > >
> > > >          MMENE_NAME    SUCC   ATT    SUCC/ATT
> > > >      CSMME15BZX   336981   368366   1
> > > >      CSMME32BZX   338754   366842   1
> > > >      CSMME07BZX   687965   747694   1
> > > >      CSMME03BHW   703269   747623   1
> > > >      CSMME12BZX   705856   764656   1
> > > >      CSMME16BHW   1962293    142173   1
> > > >
> > > >
> > > >        MMENE_NAME   SUCC   ATT   ATT/SUCC
> > > >      CSMME15BZX   336981   368366   0
> > > >      CSMME32BZX   338754   366842   0
> > > >      CSMME07BZX   687965   747694   0
> > > >      CSMME03BHW   703269   747623   0
> > > >      CSMME12BZX   705856   764656   0
> > > >      CSMME16BHW   1962293    142173   0
> > >
> > >
> > >
> > >
> > > --
> > > Best regards,
> > >
> > > Shaofeng Shi
> > >
>



-- 
Regards,

*Bin Mahone | 马洪宾*
Apache Kylin: http://kylin.io
Github: https://github.com/binmahone

Re: how to get the rate value

Posted by Li Yang <li...@apache.org>.
Thanks for the update.

On Thu, May 5, 2016 at 2:57 PM, 耳东 <77...@qq.com> wrote:

> The datatype is bigint. This problem is solved, when I change to double.
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "耳东";<77...@qq.com>;
> 发送时间: 2016年4月27日(星期三) 下午5:46
> 收件人: "dev"<de...@kylin.apache.org>;
>
> 主题: 回复: how to get the rate value
>
>
>
> the Kylin version is added in the description.
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Li Yang";<li...@apache.org>;
> 发送时间: 2016年4月27日(星期三) 下午5:07
> 收件人: "dev"<de...@kylin.apache.org>;
>
> 主题: Re: how to get the rate value
>
>
>
> Please provide the Kylin version in the JIRA.
>
> On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
> wrote:
>
> > hi dong, could you please open a JIRA to Kylin for tracking this issue?
> > https://issues.apache.org/jira/secure/Dashboard.jspa
> >
> > Thanks!
> >
> > 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
> >
> > > Hi all:
> > >
> > >
> > >       I want to get a value which is defined as sum(a)/sum(b), how can
> I
> > > do this kind of anlysis.
> > >
> > >       Now I build a cube which have sum(a) and sum(b), when I execute
> > > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> > > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
> > >
> > >
> > >          MMENE_NAME    SUCC   ATT    SUCC/ATT
> > >      CSMME15BZX   336981   368366   1
> > >      CSMME32BZX   338754   366842   1
> > >      CSMME07BZX   687965   747694   1
> > >      CSMME03BHW   703269   747623   1
> > >      CSMME12BZX   705856   764656   1
> > >      CSMME16BHW   1962293    142173   1
> > >
> > >
> > >        MMENE_NAME   SUCC   ATT   ATT/SUCC
> > >      CSMME15BZX   336981   368366   0
> > >      CSMME32BZX   338754   366842   0
> > >      CSMME07BZX   687965   747694   0
> > >      CSMME03BHW   703269   747623   0
> > >      CSMME12BZX   705856   764656   0
> > >      CSMME16BHW   1962293    142173   0
> >
> >
> >
> >
> > --
> > Best regards,
> >
> > Shaofeng Shi
> >

回复: how to get the rate value

Posted by 耳东 <77...@qq.com>.
The datatype is bigint. This problem is solved, when I change to double.


------------------ 原始邮件 ------------------
发件人: "耳东";<77...@qq.com>;
发送时间: 2016年4月27日(星期三) 下午5:46
收件人: "dev"<de...@kylin.apache.org>; 

主题: 回复: how to get the rate value



the Kylin version is added in the description.




------------------ 原始邮件 ------------------
发件人: "Li Yang";<li...@apache.org>;
发送时间: 2016年4月27日(星期三) 下午5:07
收件人: "dev"<de...@kylin.apache.org>; 

主题: Re: how to get the rate value



Please provide the Kylin version in the JIRA.

On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
wrote:

> hi dong, could you please open a JIRA to Kylin for tracking this issue?
> https://issues.apache.org/jira/secure/Dashboard.jspa
>
> Thanks!
>
> 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
>
> > Hi all:
> >
> >
> >       I want to get a value which is defined as sum(a)/sum(b), how can I
> > do this kind of anlysis.
> >
> >       Now I build a cube which have sum(a) and sum(b), when I execute
> > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
> >
> >
> >          MMENE_NAME    SUCC   ATT    SUCC/ATT
> >      CSMME15BZX   336981   368366   1
> >      CSMME32BZX   338754   366842   1
> >      CSMME07BZX   687965   747694   1
> >      CSMME03BHW   703269   747623   1
> >      CSMME12BZX   705856   764656   1
> >      CSMME16BHW   1962293    142173   1
> >
> >
> >        MMENE_NAME   SUCC   ATT   ATT/SUCC
> >      CSMME15BZX   336981   368366   0
> >      CSMME32BZX   338754   366842   0
> >      CSMME07BZX   687965   747694   0
> >      CSMME03BHW   703269   747623   0
> >      CSMME12BZX   705856   764656   0
> >      CSMME16BHW   1962293    142173   0
>
>
>
>
> --
> Best regards,
>
> Shaofeng Shi
>

回复: how to get the rate value

Posted by 耳东 <77...@qq.com>.
the Kylin version is added in the description.




------------------ 原始邮件 ------------------
发件人: "Li Yang";<li...@apache.org>;
发送时间: 2016年4月27日(星期三) 下午5:07
收件人: "dev"<de...@kylin.apache.org>; 

主题: Re: how to get the rate value



Please provide the Kylin version in the JIRA.

On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
wrote:

> hi dong, could you please open a JIRA to Kylin for tracking this issue?
> https://issues.apache.org/jira/secure/Dashboard.jspa
>
> Thanks!
>
> 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
>
> > Hi all:
> >
> >
> >       I want to get a value which is defined as sum(a)/sum(b), how can I
> > do this kind of anlysis.
> >
> >       Now I build a cube which have sum(a) and sum(b), when I execute
> > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
> >
> >
> >          MMENE_NAME    SUCC   ATT    SUCC/ATT
> >      CSMME15BZX   336981   368366   1
> >      CSMME32BZX   338754   366842   1
> >      CSMME07BZX   687965   747694   1
> >      CSMME03BHW   703269   747623   1
> >      CSMME12BZX   705856   764656   1
> >      CSMME16BHW   1962293    142173   1
> >
> >
> >        MMENE_NAME   SUCC   ATT   ATT/SUCC
> >      CSMME15BZX   336981   368366   0
> >      CSMME32BZX   338754   366842   0
> >      CSMME07BZX   687965   747694   0
> >      CSMME03BHW   703269   747623   0
> >      CSMME12BZX   705856   764656   0
> >      CSMME16BHW   1962293    142173   0
>
>
>
>
> --
> Best regards,
>
> Shaofeng Shi
>

Re: how to get the rate value

Posted by Li Yang <li...@apache.org>.
Please provide the Kylin version in the JIRA.

On Wed, Apr 27, 2016 at 1:04 PM, ShaoFeng Shi <sh...@apache.org>
wrote:

> hi dong, could you please open a JIRA to Kylin for tracking this issue?
> https://issues.apache.org/jira/secure/Dashboard.jspa
>
> Thanks!
>
> 2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:
>
> > Hi all:
> >
> >
> >       I want to get a value which is defined as sum(a)/sum(b), how can I
> > do this kind of anlysis.
> >
> >       Now I build a cube which have sum(a) and sum(b), when I execute
> > “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> > sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
> >
> >
> >          MMENE_NAME    SUCC   ATT    SUCC/ATT
> >      CSMME15BZX   336981   368366   1
> >      CSMME32BZX   338754   366842   1
> >      CSMME07BZX   687965   747694   1
> >      CSMME03BHW   703269   747623   1
> >      CSMME12BZX   705856   764656   1
> >      CSMME16BHW   1962293    142173   1
> >
> >
> >        MMENE_NAME   SUCC   ATT   ATT/SUCC
> >      CSMME15BZX   336981   368366   0
> >      CSMME32BZX   338754   366842   0
> >      CSMME07BZX   687965   747694   0
> >      CSMME03BHW   703269   747623   0
> >      CSMME12BZX   705856   764656   0
> >      CSMME16BHW   1962293    142173   0
>
>
>
>
> --
> Best regards,
>
> Shaofeng Shi
>

Re: how to get the rate value

Posted by ShaoFeng Shi <sh...@apache.org>.
hi dong, could you please open a JIRA to Kylin for tracking this issue?
https://issues.apache.org/jira/secure/Dashboard.jspa

Thanks!

2016-04-26 20:56 GMT+08:00 耳东 <77...@qq.com>:

> Hi all:
>
>
>       I want to get a value which is defined as sum(a)/sum(b), how can I
> do this kind of anlysis.
>
>       Now I build a cube which have sum(a) and sum(b), when I execute
> “select sum(a)/sum(b) from table1 group by c” ,the result is wrong.
> sum(a)/sum(b) the result is all 0 and sum(b)/sum(a) result is all 1.
>
>
>          MMENE_NAME    SUCC   ATT    SUCC/ATT
>      CSMME15BZX   336981   368366   1
>      CSMME32BZX   338754   366842   1
>      CSMME07BZX   687965   747694   1
>      CSMME03BHW   703269   747623   1
>      CSMME12BZX   705856   764656   1
>      CSMME16BHW   1962293    142173   1
>
>
>        MMENE_NAME   SUCC   ATT   ATT/SUCC
>      CSMME15BZX   336981   368366   0
>      CSMME32BZX   338754   366842   0
>      CSMME07BZX   687965   747694   0
>      CSMME03BHW   703269   747623   0
>      CSMME12BZX   705856   764656   0
>      CSMME16BHW   1962293    142173   0




-- 
Best regards,

Shaofeng Shi