Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
On a call log, I am trying to count the number of calls it takes to make 'human contact'. There is a contact_id field that groups the calls to a single individual. One individual will have one contact_id and each contact_id can have multiples rows (calls).
Human contact is establish by the field 'contacted' being populated.
I am trying to us a while loop in the load editor to obtain these results. I want to have a counter variable that will stop counting once we have identified the first 'contacted' field that is populated for each contact_id. Here is some syntax for further clarity.
let ct = 0;
while (isnull(contacted) = -1)
ct = ct + 1 ;
loop
Load
'$(ct)' as numOfCalls;
I am unsure how to fit this logic into the Load script to obtain my desired results. Any guidance or direction would be appreciated.
I don't think you need to loop over field values of a table like this. There should be shorter and better performing solutions.
Can you please provide some different examples and your expected results?
I don't think you need to loop over field values of a table like this. There should be shorter and better performing solutions.
Can you please provide some different examples and your expected results?
I was seeking an alternative method due to a bug I was having in my preferred solution. I am still learning SQL some and was not entirely sure how I could mix loops and control statements in with a select statement, if at all.
I have since then resolved said bug, and have been advised thanks to you.
As for your response, thank you, you answered my question.