Start Processing : 2025-03-15 01:35:15
0 rows affectedUPDATE db_opportunity
SET
_createTS = STR_TO_DATE(_createdDate, '%m/%d/%Y') ,
_closeTS= STR_TO_DATE(_closeDate, '%m/%d/%Y') ,
_lastModifiedTS = STR_TO_DATE(_lastModifiedDate, '%m/%d/%Y')
[10] 0.26 seconds -> 0 rows affected
update db_opportunity
set _order =
case
when _stage = 'Closed Won' then 'n'
when _stage = '06 - Contract Negotiation' then 'm'
when _stage = '05 - Selection' then 'k'
when _stage = '04 - Proposal' then 'j'
when _stage = '03 - Solution' then 'i'
when _stage = '02 - Discovery' then 'h'
when _stage = '01 - Qualification' then 'f'
when _stage = '01 - Preparation' then 'f'
when _stage = '00 - Interest' then 'e'
when _stage = 'Closed Lost' then 'd'
when _stage = 'Closed Duplicate' then 'c'
when _stage = 'Closed ? No Decision/Not Now' then 'b'
when _stage = 'Rejected - No Opportunity' then 'a'
when _stage = 'Closed Won' then 'n'
when _stage = 'Contracting' then 'k'
when _stage = 'Negotiation & Selection' then 'j'
when _stage = 'Proposal' then 'i'
when _stage = 'Solution Presentation' then 'h'
when _stage = 'Engage/Discovery' then 'g'
when _stage = '01 - Qualification' then 'f'
when _stage = '01 - Preparation' then 'f'
when _stage = 'Closed Lost' then 'd'
else '' end
[20] 0.16 seconds -> 0 rows affected
UPDATE db_opportunity
SET
_ebqSetTS = STR_TO_DATE(_ebqSet, '%m/%d/%Y') where _ebqSet != '';
[30] 0.07 seconds -> 0 rows affected
UPDATE db_opportunity
SET
_ebqCompletedTS = STR_TO_DATE(_ebqCompleted, '%m/%d/%Y') where _ebqCompleted != '';
[40] 0.05 seconds -> 0 rows affected
TRUNCATE db_ebq_opportunities_eo
[50] 0.12 seconds -> 0 rows affected
insert into db_ebq_opportunities_eo
(_opportunitySource, _accountName, _opportunityName, _opportunityID, _opportunityOwner, _totalAcv, _annualAmount, _amount, _accountID, _industry, _age, _type, _stageDuration, _leadSource, _channel, _lineOfBusiness, _reasonLost, _accountTier, _stage, _salesTeam, _team, _loanOriginationSystem, _documentPrep, _estimatedAnnualLoanVolume, _primaryCampaign, _primaryCampaignSource, _contactEmail, _createdTS, _closeTS, _ebqSetTSwk, _ebqCompletedTSwk, _createdMonth, _createdYear, _client)
select
_opportunitySource, _accountName, _opportunityName, _opportunityID, _opportunityOwner, _totalAcv, _annualAmount, _amount, _accountID, _industry, _age, _type, _stageDuration, _leadSource, _channel, _lineOfBusiness, _reasonLost, _accountTier, _stage, _salesTeam, _team, _loanOriginationSystem, _documentPrep, _estimatedAnnualLoanVolume, _primaryCampaign, _primaryCampaignSource, _contactEmail, _createTS, _closeTS, _ebqSetTS, _ebqCompletedTS, month(_createTS) as _createdMonth,year(_createTS) as _createdYear, 'eO' as _client
from db_opportunity where _opportunitySource in ('Televerde', 'EBQ') && _accountName not like '%TEST ACCOUNT%' && _accountName not like '%testing%' && _opportunityName not in ('Axis Auto Finance' ,'Fuel Capital Group - TV Lead')
[60] 0.56 seconds -> -1 rows affected
TRUNCATE abm_oppty
[70] 0.09 seconds -> 0 rows affected
insert ignore into abm_oppty (_accountName, _accountID, _opportunityName, _opportunityID, _stage, _opportunityOwnerFullName, _contactFullName, _accountIndustry, _totalAcv, _amount, _discoveryNotes, _statusAndNextSteps, _createdDate, _closeDate, _lastModifiedDate, _leadSource, _leadSourceBucket, _opportunitySource, _primaryCampaignSource, _primaryCampaignName, _reasonLost, _createdTS, _closeTS)
SELECT _accountName, _accountID, _opportunityName, _opportunityID, _stage, _opportunityOwner, _contactEmail, _industry, _annualAmount, _amount, _discoveryNotes, _statusAndNextSteps, _createdDate, _closeDate, _lastModifiedDate, _leadSource, _leadSourceBucket, _opportunitySource, _primaryCampaignSource, _primaryCampaign, _reasonLost, _createTS, _closeTS FROM db_opportunity
where _opportunitySource in ('Televerde', 'EBQ', 'AE Generated', 'DS Referral', 'Other Partner Referral', 'Client Referral', '') && _type = 'New Customer' && _createTS >= '2020-07-01';
[80] 1.34 seconds -> 2229 rows affected
TRUNCATE abm_generated_oppty
[90] 0.16 seconds -> 0 rows affected
insert ignore into abm_generated_oppty
select * from abm_oppty where _opportunitySource in ('Televerde', 'EBQ', 'AE Generated')
&& concat(_primaryCampaignSource, _primaryCampaignName) != '' && _primaryCampaignName not like '%Prospecting%';
[100] 0.39 seconds -> 711 rows affected
TRUNCATE abm_influenced_oppty
[110] 0.15 seconds -> 0 rows affected
insert ignore into abm_influenced_oppty
select * from abm_oppty where
_createdTS >= '2020-07-01'
&& _opportunitySource in ('Televerde', 'EBQ', 'AE Generated', 'DS Referral', 'Other Partner Referral', 'Client Referral', '')
&& concat(_primaryCampaignSource, _primaryCampaignName) = ''
or _primaryCampaignName like '%Prospecting%';
[120] 0.78 seconds -> 1237 rows affected