Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated dimension

How do I create a new calculated dimension from the sql load script? 

I am loading date from sql query and would like to calculate week during load. 
The below code works, but I cannot see WorkWeek as a dimension after load completes. 

SELECT Epi_Lot.Start_Date
FROM BlueDB.dbo.table;
Let WorkWeek = Week(start_date);

6 Replies
Not applicable
Author

You can do the same thing on your script
LOAD *,

Week(Start_Date) as WorkWeek;

SQL

SELECT Epi_Lot.Start_Date

FROM BlueDB.dbo.table;


Hope this helps

Regards


Pablo




rustyfishbones
Master II
Master II

you can try this

MainTable:

SELECT Epi_Lot.Start_Date

FROM BlueDB.dbo.table;

Week:
Load distinct
Week(Start_Date) AS Week,

     Resident MainTable;

rustyfishbones
Master II
Master II

here is an image of something similar

2013-10-14_1910.png

Clever_Anjos
Employee
Employee

LOAD

     *,

Week(Start_Date) AS Week;

SELECT

   Epi_Lot.Start_Date,

FROM BlueDB.dbo.table;

Not applicable
Author

This works!  The examples helped.  Thanks everyone.

rustyfishbones
Master II
Master II

That's great Susan.

You need to mark the correct answer to help others in the community find the correct answers to similar questions