Hi Hongbin,

Thanks so so so ... much for your kind help.
The following is my understanding based on your excellent explanation:
Since both the foreign key and "WEEK_BEG_DT" are in the cube and 
"WEEK_BEG_DT" can be derived from the foreign key, we mark the column
"WEEK_BEG_DT" as a derived dimension in the UI. The same case happens for 
"USER_DEFINED_FIELD1","USER_DEFINED_FIELD3","UPD_DATE" and "UPD_USER"
columns. Can I ask which column is the foreign key for the table "KYLIN_CAL_DT"?

The following is another understanding based on reference link [1]. In [1] 
(page 10),
"Dimensions on lookup table that can be derived by PK." It seems that the 
primary
Key is the column that other columns are derived from. Back to the sample cube
example, since both the primary key and "WEEK_BEG_DT" are in the cube and 
"WEEK_BEG_DT" can be derived from the primary key, we mark the column
"WEEK_BEG_DT" as a derived dimension in the UI. I assume the primary key
in the table "KYLIN_CAL_DT" is "CAL_DT"?

Please help me verify the above two explanations, thanks a million. 

[1] 
http://www.slideshare.net/YangLi43/design-cube-in-apache-kylin?next_slideshow=5

Best regards,
Zhong

-----Original Message-----
From: hongbin ma [mailto:mahong...@apache.org] 
Sent: Thursday, January 07, 2016 7:30 AM
To: dev@kylin.apache.org
Subject: Re: derived dimension

if the dimension's not explicitly specifying, FK is the column that's derived 
from.

On Thu, Jan 7, 2016 at 11:15 AM, Zhang, Zhong <zzh...@cardlytics.com> wrote:

> Hi All,
>
> I'm confused by the derived dimension. The following two sentences are 
> the source that I found online to guide me use derived dimension. It's 
> kind of unclear to me.
>
> Dimensions on lookup table that can be derived by PK.
> -like User ID derives [Name, Age, Gender] from [1] at page 10
>
> Given a value in DimA, the value of DimB is determined, so we say dimB 
> can be derived from DimA. When we build a cube that contains both DimA 
> and DimB, we simple include DimA, and marking DimB as Derived.
> from [2]
>
> Let us use the sample cube "kylin_sales_cube" as the example to 
> discuss it. There are two derived dimensions: CAL_DT and CATEGORY.
> In CAL_DT, which column derives WEEK_BEG_DT?
> In CATEGORY, which column derives
> "USER_DEFINED_FIELD1","USER_DEFINED_FIELD3","UPD_DATE","UPD_USER"?
>
> Is derived dimension used only in lookup table?
>
> [1]
> http://www.slideshare.net/YangLi43/design-cube-in-apache-kylin?next_sl
> ideshow=5
> [2]
> https://mail-archives.apache.org/mod_mbox/incubator-kylin-dev/201507.m
> box/%3c82073af5-ae07-4441-bfdf-e8b9d36ff...@163.com%3E
>
> Best regards,
> Zhong
>



--
Regards,

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

Reply via email to