Discussion Board for collaboration on QlikView Scripting.
i have a dimension without a unique key.
say for example, in Customer dimension, one customer can belong to many REP’s in same State.
how can I join this dimension with my Transactions fact table?
Ex Customer Table:
so, any ideas to generate a unique key in this scenario?
Can u provide structure for your FACT's and DIMENTIONS
You could use AutonumberHash256 function to generate unique id:
AutonumberHash256(Customer, REP) as IDCustomerREP
Hi Sushil & Whiteline,
i think, i didn't explain the scenario properly.
I do have Customer & State fields in sales fact table.
i need to connect this Sales table to Customer dimension by depending on those fields.
Thanks for your help.
What are the fields in sales table??
SO No,Customer, State,Revenue.
Thanks for ur reply.
Then customer is common field to each other. so they automatically combine with each other but change the state field name as saleState. Otherwise, it form loop or synthetic key..
Try like this
Load customer&''&State as Key,customer as salesCutomer, state as salesState, revenue,soNo from sales;
Load customer&state as Key,state, customer ,rep from customertable where exists(Key,Key);
//by this,second table load only if key exists in the first table only..
see this link:
Hope it helps
but the problem is customer&state as Key is not a unique key in Customer dimension.
one customer can have many rep's for same state.
then u tey first approach..make customer field as common to both tsble n rename state field.. How u expecting
The result..can u post a sample file n expecting result..by that can easy to solve ur requirement..
Join , inner join, left join, concantenate concept also use to combine tables but without kowing the expected result its difficult to find
I might be missing something but given a sales order it's not possible to tell the right sales rep.
Using Mayil approach, you can create a more complex key, using Customer & '|' & State & '|' & Rep as Key, but there would be no link to the sales, right?
If you provide us some data samples, we can better understand the problem.