Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to represent boolean flag representation in FACT?

3 posters

Go down

How to represent boolean flag representation in FACT? Empty How to represent boolean flag representation in FACT?

Post  rameshusa Tue Apr 23, 2013 11:50 am

I have a degenerate dimesnion called Treaty or Facultative Flag for my insurance needs. When I add the flag to the FACT Table, Is it better to add it as char(1) or 1/0 as a number?

Will there be a performance benefits in using 1/0 over the Y/N? The FACT table may contain about 15 Million Rows?

Thanks,

rameshusa

Posts : 3
Join date : 2013-04-17

Back to top Go down

How to represent boolean flag representation in FACT? Empty Re: How to represent boolean flag representation in FACT?

Post  ngalemmo Tue Apr 23, 2013 2:20 pm

Or a Boolean.

Do whatever you want. It doesn't really matter all that much. It is a matter of style and what the business users would like to see.
ngalemmo
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

http://aginity.com

Back to top Go down

How to represent boolean flag representation in FACT? Empty Re: How to represent boolean flag representation in FACT?

Post  BoxesAndLines Tue Apr 23, 2013 2:55 pm

Use the smallest numeric datatype available. Don't use boolean since you cannot sum boolean natively.
BoxesAndLines
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

Back to top Go down

How to represent boolean flag representation in FACT? Empty Re: How to represent boolean flag representation in FACT?

Post  ngalemmo Tue Apr 23, 2013 3:55 pm

BoxesAndLines wrote:Use the smallest numeric datatype available. Don't use boolean since you cannot sum boolean natively.

Yeah, but you really can't sum any of it natively. If true = 1 and false = 0, how do I sum the number of false? I need to use a comparative expression, I cannot use sum() alone.
ngalemmo
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

http://aginity.com

Back to top Go down

How to represent boolean flag representation in FACT? Empty Re: How to represent boolean flag representation in FACT?

Post  BoxesAndLines Tue Apr 23, 2013 10:11 pm

Good point. I normally include a default metric for all fact tables with the value of 1 (really handy for factless facts). In this case of false I would sum the default metric where cond = 0.
BoxesAndLines
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

Back to top Go down

How to represent boolean flag representation in FACT? Empty Re: How to represent boolean flag representation in FACT?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum