Generating A Session Key

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
debrujr
Participant
Posts: 56
Joined: Fri Jul 31, 2009 1:05 pm
Location: South

Generating A Session Key

Post by debrujr »

Greetings all,

I am looking for a way to generate a key to be housed on my fact table that can be used to lookup many attribute records. Sounds simple but I can't find a good way to do it. The scenario I have is that I am trying to relate a number of clicks to a session or time period of an individual. Picture a fact table having just the static attributes for a session of time and then another table that contains the specific info for each click in that session. There is a time delineation that will dictate the beginning and end of sessions.

My thought is that I can sort my data on the id column associated to an individual as well as a timestamp and then spin through the data assigning a new key when I see a new person or a span of time that does not fall within the same session for the same person.

I am threatening to write a custom operator but it has been 10+ years since I wrote C so I would like to know if there is a more elegant approach. Cheers!
debrujr
Participant
Posts: 56
Joined: Fri Jul 31, 2009 1:05 pm
Location: South

Post by debrujr »

Nevermind. I figured out a way to do it. I can sort the data like I had intended with using my individual id and then time and then copying the data and adding a key column to each copy, one starting and one and the other starting at 2. Then I can join them togethar by the key I appended and the indiv key so that should give me groupings as long as b.id is not null. I know it is kind of a ramble but if I get it working I will post it up. Thanks
Post Reply