Got the solution for the solution for this , we can join these two tables 
on city_code and get the relevant city_id from city_dimension.


select *, $cityD as city_id from Sfact let cityD = ( select id from cityDim 
where cityName = $parent.$current.city )

Hope this will help many Newbies users of orientdb.



On Monday, 16 February 2015 14:55:06 UTC+5:30, Shivanandan Gupta wrote:
>
> Hi All,
>
> I am trying to load a table where I have to lookup dimension table based 
> on code  ( which is present in the stage table )
>
>
> CITY Dimension table
>
> ID CITY_NAME
> 1       LONDON
> 2       SINGAPORE
> 3       NEW YORK
> 4       SEATTLE
>
> S_FACT FACT TABLE
>
> PERSON_NAME       CITY 
> ANDY                      SINGAPORE
> SANDY                      LONDON
> MANDY                        NEW YORK
>
>
> F_FACT TABLE ( I want to load f_fact table by looking up to city dim using 
> city_name from s_fact table equal to city_name in city_dimension and get 
> the equivalent ID from dimension table )
>
> PERSON_NAME    CITY_ID
> ANDY                       2
> SANDY                     1
> MANDY                    3
>  
>
>
> Any help will be appreciated. Thanks in advance.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to