Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
peterderrington
Creator II
Creator II

Calculation Question

I'm not sure if this can be done due to the structure of my data but.......

I want to work out some average customer timelines. I have a static excel file with all the data on that lists each customer interaction.

On each line there are two customer unique ID codes that that customer has for life irrespective of the interactions we may have with them.

On the line there will also be a couple of location codes and a date/time stamp.

What i want to do is work out the length of time that customer has spent at a location (based on subtracting the timestamp from both lines) and then determine the average time that customers spend at that given location.

To make things more complicated, customers may often bounce between locations and home and i won't know when they've gone home so i think i'll probably need to have a filter that says something like "if we cant find customer A after X number of days then ignore"

Is that making sense?

Below is a rough mock up of the data:

      

Unique ID 1Unique ID 2IDDate StampLocation ALocation B
12345678John Smith03/10/2014 19:15Shop 1Shop 2
23456789Fred Jones03/10/2014 20:05Shop 2Shop 1
12345678John Smith05/10/2014 17:00Shop 2Shop 3

So in this example i would subtract the two John Smith date stamps and it would spit out an answer of 45 hours and 45 minutes for time spent at 'Shop 2' and i would then want to look at all of those results for 'Shop 2' and produce an average.

12 Replies
peterderrington
Creator II
Creator II
Author

I'm obviously having a dim moment but I cant recreate your table.

Am I right in thinking there's no dimension and its all done with expressions. I just cant seem to get it to show anything.

Sorry, I've had a couple of long hard days recently and my brain has turned to mush.

chrismarlow
Specialist II
Specialist II

Hi Peter,

Attaching the app. I have personal edition, so hopefully you can open, but happy to paste in the expressions if not. Let me know.

Cheers,

Chris.

peterderrington
Creator II
Creator II
Author

Fantastic, that's great, I'm starting to replicate them now with the real data and its starting to show things.

I'll have a play around and get back to you.

Thanks.