Skip to Content
0
Former Member
Jan 30, 2016 at 02:27 AM

Help with Summary Table please (Context issue?)

22 Views

Hello,

Could someone please help me specify the correct context for the following?

I have the following table of interactions for an Incident

Incident Id Date Username Status FLAG Interaction Type #1 ... Interaction Type A Time 1 Username 1 Based on Previous(Status) etc will be 1 if matches status, or NULL if not A Time 2 Username 1 A Time 3 Username 2 B Time 1 Username 1

Incase it matters, Incident Id, Date, and Username are all merged dimensions of two query results.

I now want to create a summary table of the count of each type of Interaction Types for each Username.

Username Interaction Type #1 Interaction Type #2 Username 1 5 4 Username 2

I have tried multiple variants of contexts, and sum/count but the totals are never correct and I cannot work out why. I have spent many hours reading about contexts. I think that potentially how I am writing the context is changing the results whether it meets the criteria of the interaction type, or I am just getting the context completely wrong... The last one I've tried:

Sum([FLAG Interaction 1]) ForEach ([Incident Id]; [Date]) Where ([Date] = [Today])) ForAll ([Incident Id];[Date]))

Can someone please let me know how to write the context?

Many thanks!

Wayne