Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Second connection

Hi,

I'm reporting on a telephone database and need a script that gives me the time of the first connection after the first throughconnect.

Examples below:

INI - Inbound Call start    

CON - Connection

HEL - Held

INT - ThroughConnect

DIS - DisConnection

Example 1:

CallIdEventEventTime
123INI12:01:33
123CON12:01:38
123HEL12:01:43
123CON12:01:50
123INT12:02:03
123CON12:02:10
123INT12:03:15
123CON12:03:20
123DIS12:03:40

Example 2:

CallIdEventEventTime
123INI12:01:33
123CON12:01:50
123INT12:02:03
123CON12:02:10
123DIS12:03:40

Example 3:

CallIdEventEventTime
123INI12:01:33
123CON12:01:38
123CON12:01:43
123CON12:01:50
123INT12:02:03
123CON12:02:10
123INT12:03:15
123CON12:03:20
123DIS12:03:40


Thanks for your help!

Best regards,

Arjan

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Arjan,

Please check the application attached.

Regards.

Miguel

View solution in original post

6 Replies
Miguel_Angel_Baeyens

Hi Arjan,

I have not tested it but it seems a case to use RangeSum(), Peek() and Previous() functions in the script. The script should look like the following:

TableTmp:

LOAD CallId,

     Event,

     EventTime

FROM

testCallId.xlsx

(ooxml, embedded labels, table is Sheet1);

Table:

LOAD *,

     If(CallId = Previous(CallId), If(Event = 'CON' AND Previous(Event) = 'INT', RangeSum(Peek('EventTimeCntr'), 1), Peek('EventTimeCntr')), 0) AS EventTimeCntr,

     If(CallId = Previous(CallId), If(Event = 'CON' AND Previous(Event) = 'INT' AND RangeSum(Peek('EventTimeCntr'), 1) = 1, EventTime)) AS EventTimeFirstINT

RESIDENT TableTmp

ORDER BY CallId, EventTime;

DROP TABLE TableTmp;

I may have missed some parentheses or commas, but that's the idea.

Hope that helps.

Miguel

Anonymous
Not applicable
Author

Hi,

What do you mean with:

RangeSum(Peek('EventTimeCntr'), 1))) AS EventTimeCntr

I only get NullValues.....

Arjan

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi ,

Please Explain detaily .How u need Result .if u Possible Upload sample Data

Regards

Perumal A

Anonymous
Not applicable
Author

Here some testdata.....hope you can help me!

Arjan

Miguel_Angel_Baeyens

Hi Arjan,

Please check the application attached.

Regards.

Miguel

Anonymous
Not applicable
Author

Hi Miguel,

Thanks for your help!!!!!!!

Regards,

Arjan