SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
2013-today QA/QC of spatial data AKN
2013-2013 BI Analyst 6PM
Name
2007-2013 LPIS Administrator MZSV
1999-2007 Database Developer KBR
Phone
Email Education
1990-1995
2014-
Skills
Personal Skills
! "
"
#$
%
&
#
'@saso70
Excellent knowledge in RDBMS concepts
Worked on end-user testing and on-line retrieval
Maximizing Value-Added Performance (MVP)
Forward Operation Base (FOB) badges
Tracking 10,000 Local Nationals (LNs) and Third Country Nationals(TCNs).
Professional Skills
Points, Check Points, Logging
Exceptionally good problem solving and trouble shooting skills
Developed a new military database and badge template for the area
' # " # ( ) *+, -. /*. *.0 ) 1,-02 3
Profile
' # " #
Date of Birth
/+ ( 1,-0
Address
4 !! 5
1*00 6 7 "
3
8*+, -. /*. *.0
1,-02 3
Social
Bachelor of Science Major in Geodesy Science
MCSA: SQL Server 2012
Prepared 7 themes for Euro Regional-Map including :Admin Border,
Hydrography, Transportation, Built-up areas, Soil and vegetation,
Miscellaneous object and named locations,Creating ERM Data Model
has gathered all feature classes into a georelational data model.
Creating drill down, drill through and linked reports using SSRS
Develop Business Intelligence reports, dashboards, and related visuals
Testing reports created in new QlikView
Utilizing SSIS 2012 creating package for Incremental and initial Load
Experience in Extraction, Transforming and Loading (ETL)
Experience in Error and Event Handling: Precedence Constraints, Break
MY SELF
Casino Campaigns – Retention
SELECT
tm.merchantName,
tb.brandName,
'Retention' AS ListType,
tc.customerEmail AS [E-Mail],
tc.customerFirstName AS [First Name],
CASE WHEN tc.countryCode IN ('SE', 'NO', 'FI', 'LV', 'PL','AT','CH','DE') THEN tcy.countryName
ELSE 'ROW'
END Country,
vus.segmentName AS [Main Segment],
vussub.segmentName AS [Sub Segment],
tc.customerCellPhone AS [Mobile Phone Number],
tc.customerRegistrationLanguageCode AS registrationLanguageCode,
cm.level1FriendlyName AS customerMarketName,
tc.src_customerId AS srcCustomerId,
ISNULL(ISNULL(temp.casinoModuleUserName,cpm.providerAlias),'NOT AVAILABLE') AS netEntCasinoUserId,
tc.AcceptSmsOffers AS [Accept SMS Offers],
tc.AcceptEmailOffers AS [Accept Newsletter],
tc.lastLoginGMT AS LastLoginDate,
DATEDIFF(DAY,tc.lastLoginGMT,GETDATE()) AS daysSinceLastLogin,
tc.lastPlayedNetentCasinoGMT AS lastActiveDate,
DATEDIFF(DAY,tc.lastPlayedNetentCasinoGMT,GETDATE()) AS daysSinceLastActive,
tc.firstDepositGMT AS firstDepositDate,
DATEDIFF(DAY,tc.firstDepositGMT,GETDATE()) AS daysSinceFirstDeposit,
tus.customerStatus AS accountStatus,
gamewinAllCasino.customerRevenue AS lifetimeCasinoAccountingRevenue ,
CASE WHEN DATEDIFF(month,tc.firstPlayedNetentCasinoGMT,tc.lastPlayedNetentCasinoGMT) = 0 THEN gamewinAllCasino.customerRevenue
ELSE (gamewinNetEnt.customerRevenue / DATEDIFF(month,tc.firstPlayedNetentCasinoGMT,tc.lastPlayedNetentCasinoGMT))
end AS averageCasinoAccountingRevenuePerActiveCasinoMonth,
DepositAmt.pmtDepositAmount AS lifetimeDepositAmount
FROM TDM..tcurrentCustomer tc (NOLOCK)
inner join TDM..tcustomerState tus (NOLOCK) on tus.sk_customerState = tc.sk_customerState
inner join TDM..tsegment vus (NOLOCK) on vus.segmentID = tc.currentSegmentID
inner join TDM..tsegment vussub (NOLOCK) on vussub.segmentID = tc.currentSubSegmentID
INNER JOIN tdw..tmerchant tm ON tm.sk_merchant = tc.sk_merchant
INNER JOIN tdw..tbrand tb ON tc.sk_registerBrand = tb.sk_brand
INNER JOIN tdw..tcustomerMarket cm ON cm.customerMarketID = tc.customerMarketID
LEFT JOIN tdw..tcountry tcy ON tc.countryCode = tcy.CountryCode
left join ( SELECT
gs.sk_customer,
gs.casinoModuleUserName
from TDW..tgameStatNetentCasinoDaily gs
inner join
(
SELECT
MAX(gs.calendarDateCET) lastcalendarDateCET,
gs.sk_customer
FROM TDW..tgameStatNetentCasinoDaily gs
GROUP BY
gs.sk_customer
) gs_un on gs.calendarDateCET = gs_un.lastcalendarDateCET and gs_un.sk_customer = gs.sk_customer
WHERE gs.migrationSourceID = -1
AD-HOC QUERY
Casino Campaigns – Retention
AD-HOC QUERY
) temp ON temp.sk_customer = tc.sk_customer
left join TDW..tcustomerProviderMapping cpm ON tc.sk_customer = cpm.sk_customer AND cpm.sk_provider = 1
left join
(
select pgs.sk_customer, SUM(pgs.revenue_EUR) as customerRevenue, sum(pgs.bet_EUR) as lifetimeBet
from tdm..tproviderGameStat pgs (NOLOCK)
INNER JOIN tdw..tprovider tp ON pgs.sk_provider = tp.sk_provider
WHERE tp.biProductID = 2
group by pgs.sk_customer
) gamewinAllCasino
on tc.sk_customer = gamewinAllCasino.sk_customer
left join
(
select pgs.sk_customer, SUM(pgs.revenue_EUR) as customerRevenue, sum(pgs.bet_EUR) as lifetimeBet
from tdm..tproviderGameStat pgs (NOLOCK)
WHERE pgs.sk_provider = 1
group by pgs.sk_customer
) gamewinNetEnt
on tc.sk_customer = gamewinNetEnt.sk_customer
left join
(
select ti.sk_customer, SUM(ti.pmtAmount_EUR) as pmtDepositAmount
from tdm..tpmtTransactionInfo ti (NOLOCK)
where ti.sk_pmtStatus in (2, 3)
and ti.sk_pmtType = 1
group by ti.sk_customer
) DepositAmt
on tc.sk_customer = DepositAmt.sk_customer
WHERE tc.lastLoginGMT >= (DATEADD(d,-45,GETDATE()))
AND (vus.segmentName IN ('NDC', 'SP', 'RP', 'IP', 'VIP1', 'VIP2', 'VIP3', 'VIP4', 'VIPN', 'NRC', 'VIP_POTENTIAL',)
AND vussub.segmentName IN ('CASINO_CRY', 'CASINO_EVO', 'CASINO_GTS', 'CASINO_MGC', 'CASINO_NTN', 'CASINO_PNG,
'SPORT_CASINO', 'CASINO_POKER', 'POKER_CASINO', 'MULTIPRODUCTS'))
AND tc.sk_registerBrand = 19
and tc.countryCode NOT IN ('BE','CA','CN','GR','MY','NL','PT','RO','UA')
Casino Campaigns – Retention
GET ISO WEEK
CREATE FUNCTION [DBO].[fnGetIsoYearIsWeek]
(
@THEDATE DATETIME
)
RETURNS NVARCHAR(10)
AS
BEGIN
DECLARE @MONTH INT, @WEEK INT
SET @WEEK = DATEPART(ISOWK, @THEDATE)
SET @MONTH = DATEPART(MONTH, @THEDATE)
IF @WEEK = 53 AND @MONTH = 1 BEGIN
RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, DATEADD(YEAR, -1, @THEDATE))) +
' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2)
END
IF @WEEK = 1 AND @MONTH = 12 BEGIN
RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, DATEADD(YEAR, 1, @THEDATE))) +
' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2)
END
RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, @THEDATE)) +
' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2)
END
GET FIRST DAY OF MONTH
CREATE FUNCTION [dbo].[ufn_GetFirstDayOfMonth] ( @pInputDate DATETIME )
RETURNS DATETIME
BEGIN
RETURN CAST(CAST(YEAR(@pInputDate) AS VARCHAR(4)) + '-' +
CAST(MONTH(@pInputDate) AS VARCHAR(2)) + '-01' AS DATETIME)
END
GET LAST DAY OF MONTSELECT
gs.sk_customer,
CREATE FUNCTION [dbo].[ugs.casinoModuleUserName
RETURNS DATETIME from TDW..tgameStatNetentCasinoDaily gs
BEGIN inner join
DECLARE (
SET @vOutputDate = SELECT
MAX(gs.calendarDateCET) lastcalendarDateCET,
SET @vOutputDate = gs.sk_customer
RETURN @vOutputDateFROM TDW..tgameStatNetentCasinoDaily gs
END
UDF-Functions
Casino Campaigns – Retention
USE [TDM]
GO
CREATE PROCEDURE [dbo].[rpt_overview_report_Games_overview]
@startDate datetime,
@endDate datetime,
@customerMarketID_List TEXT,
@groupBy int = 0,
@sk_customerType int = 1 -- User2 - Test User
with recompile AS
BEGIN
CREATE TABLE #customerMarket
(
customerMarketID INT
)
INSERT INTO #customerMarket
SELECT *
FROM ProcessRepository..fnSplitText(@customerMarketID_List) s
------
SELECT
ISNULL(gt.[gameType],'Not Classified') AS [gameType],
g.gameName ,
CASE WHEN @groupBy = 0
THEN CONVERT(NVARCHAR(10), DATEADD(DAY, DATEDIFF(DAY, 0,gs.calendarDateCET), 0), 120)
WHEN @groupBy = 1
THEN tdm.dbo.fnGetIsoYearIsoWeek(gs.calendarDateCET)
WHEN @groupBy = 2
THEN CONVERT(NVARCHAR(4), DATEPART(YEAR, gs.calendarDateCET)) + '-' +
RIGHT('0' + CONVERT(VARCHAR, DATEPART(MONTH, gs.calendarDateCET)),2)
WHEN @groupBy = 3
THEN CONVERT(NVARCHAR(30), DATEADD(DAY,DATEDIFF(DAY, 0, @startDate),0), 112)
+ ' - '+ CONVERT(NVARCHAR(30), DATEADD(DAY, DATEDIFF(DAY, 0, @endDate), 0), 112)
END AS period,
SUM(gs.bet) AS Turnover ,
SUM(gs.win) AS Winings ,
COUNT(gs.sk_customer) AS count_ActiveCustomers
FROM tgamestat gs
INNER JOIN dbo.tgame g ON gs.gameID = g.gameID
LEFT OUTER JOIN kufa88GameTypes gt ON gt.game = g.gameName
INNER JOIN tdm..tcurrentCustomer cc (NOLOCK) ON gs.sk_customer = cc.sk_customer
INNER JOIN #customerMarket cm ON cm.customerMarketID = cc.customerMarketID
WHERE gs.calendarDateCET >= @startDate
AND gs.calendarDateCET <= @endDate
AND gs.gameID <> -1
--AND cc.sk_customerType = @sk_customerType -- both Regular and Test Users will be included
GROUP BY gt.[gameType] ,
g.gameName ,
CASE WHEN @groupBy = 0
THEN CONVERT(NVARCHAR(10), DATEADD(DAY, DATEDIFF(DAY, 0,gs.calendarDateCET), 0), 120)
WHEN @groupBy = 1
THEN tdm.dbo.fnGetIsoYearIsoWeek(gs.calendarDateCET)
WHEN @groupBy = 2
SSRS-Report
Casino Campaigns – Retention
SSRS-Report
THEN CONVERIGHT('0' + CONVERT(VARCHAR, DATEPART(MONTH, gs.calendarDateCET)),2)
WHEN @groupBy = 3
THEN CONVECONVERT(NVARCHAR(30), DATEADD(DAY, DATEDIFF(DAY, 0, @endDate), 0), 112)
END
---------------------------------------
DROP TABLE #customerMarket
END
Casino Campaigns – Retention
SSRS-Report

Contenu connexe

Similaire à Work in TDW

apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Reportnyin27
 
Greg Lewis SQL Portfolio
Greg Lewis SQL PortfolioGreg Lewis SQL Portfolio
Greg Lewis SQL Portfoliogregmlewis
 
MongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDBMongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDBOfer Cohen
 
Uncovering SQL Server query problems with execution plans - Tony Davis
Uncovering SQL Server query problems with execution plans - Tony DavisUncovering SQL Server query problems with execution plans - Tony Davis
Uncovering SQL Server query problems with execution plans - Tony DavisRed Gate Software
 
Introduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraIntroduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraDataStax Academy
 
MySQL Built-In Functions
MySQL Built-In FunctionsMySQL Built-In Functions
MySQL Built-In FunctionsSHC
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson PortfolioKbengt521
 
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...Altinity Ltd
 
SQL Server part 1 (6).pptx
SQL Server part 1 (6).pptxSQL Server part 1 (6).pptx
SQL Server part 1 (6).pptxdeepneuron
 
Cdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetupCdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetupchristkv
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsOdoo
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation SpecificationsUnmon Mukherjee
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfoliomaywoo
 

Similaire à Work in TDW (20)

apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wiseapidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
apidays Singapore 2023 - Iterate Faster with Dynamic Flows, Yee Hui Poh, Wise
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
 
Greg Lewis SQL Portfolio
Greg Lewis SQL PortfolioGreg Lewis SQL Portfolio
Greg Lewis SQL Portfolio
 
MongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDBMongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDB
 
Uncovering SQL Server query problems with execution plans - Tony Davis
Uncovering SQL Server query problems with execution plans - Tony DavisUncovering SQL Server query problems with execution plans - Tony Davis
Uncovering SQL Server query problems with execution plans - Tony Davis
 
My Portfolio
My PortfolioMy Portfolio
My Portfolio
 
My Portfolio
My PortfolioMy Portfolio
My Portfolio
 
Introduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for CassandraIntroduction to Dating Modeling for Cassandra
Introduction to Dating Modeling for Cassandra
 
MySQL Built-In Functions
MySQL Built-In FunctionsMySQL Built-In Functions
MySQL Built-In Functions
 
Kevin Bengtson Portfolio
Kevin Bengtson PortfolioKevin Bengtson Portfolio
Kevin Bengtson Portfolio
 
Mcs 17 solved assignment 2015- 16
Mcs 17 solved assignment 2015- 16Mcs 17 solved assignment 2015- 16
Mcs 17 solved assignment 2015- 16
 
Super spike
Super spikeSuper spike
Super spike
 
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
 
SQL Server part 1 (6).pptx
SQL Server part 1 (6).pptxSQL Server part 1 (6).pptx
SQL Server part 1 (6).pptx
 
Cdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetupCdr stats-vo ip-analytics_solution_mongodb_meetup
Cdr stats-vo ip-analytics_solution_mongodb_meetup
 
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo apps
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation Specifications
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfolio
 

Work in TDW

  • 1. 2013-today QA/QC of spatial data AKN 2013-2013 BI Analyst 6PM Name 2007-2013 LPIS Administrator MZSV 1999-2007 Database Developer KBR Phone Email Education 1990-1995 2014- Skills Personal Skills ! " " #$ % & # '@saso70 Excellent knowledge in RDBMS concepts Worked on end-user testing and on-line retrieval Maximizing Value-Added Performance (MVP) Forward Operation Base (FOB) badges Tracking 10,000 Local Nationals (LNs) and Third Country Nationals(TCNs). Professional Skills Points, Check Points, Logging Exceptionally good problem solving and trouble shooting skills Developed a new military database and badge template for the area ' # " # ( ) *+, -. /*. *.0 ) 1,-02 3 Profile ' # " # Date of Birth /+ ( 1,-0 Address 4 !! 5 1*00 6 7 " 3 8*+, -. /*. *.0 1,-02 3 Social Bachelor of Science Major in Geodesy Science MCSA: SQL Server 2012 Prepared 7 themes for Euro Regional-Map including :Admin Border, Hydrography, Transportation, Built-up areas, Soil and vegetation, Miscellaneous object and named locations,Creating ERM Data Model has gathered all feature classes into a georelational data model. Creating drill down, drill through and linked reports using SSRS Develop Business Intelligence reports, dashboards, and related visuals Testing reports created in new QlikView Utilizing SSIS 2012 creating package for Incremental and initial Load Experience in Extraction, Transforming and Loading (ETL) Experience in Error and Event Handling: Precedence Constraints, Break MY SELF
  • 2. Casino Campaigns – Retention SELECT tm.merchantName, tb.brandName, 'Retention' AS ListType, tc.customerEmail AS [E-Mail], tc.customerFirstName AS [First Name], CASE WHEN tc.countryCode IN ('SE', 'NO', 'FI', 'LV', 'PL','AT','CH','DE') THEN tcy.countryName ELSE 'ROW' END Country, vus.segmentName AS [Main Segment], vussub.segmentName AS [Sub Segment], tc.customerCellPhone AS [Mobile Phone Number], tc.customerRegistrationLanguageCode AS registrationLanguageCode, cm.level1FriendlyName AS customerMarketName, tc.src_customerId AS srcCustomerId, ISNULL(ISNULL(temp.casinoModuleUserName,cpm.providerAlias),'NOT AVAILABLE') AS netEntCasinoUserId, tc.AcceptSmsOffers AS [Accept SMS Offers], tc.AcceptEmailOffers AS [Accept Newsletter], tc.lastLoginGMT AS LastLoginDate, DATEDIFF(DAY,tc.lastLoginGMT,GETDATE()) AS daysSinceLastLogin, tc.lastPlayedNetentCasinoGMT AS lastActiveDate, DATEDIFF(DAY,tc.lastPlayedNetentCasinoGMT,GETDATE()) AS daysSinceLastActive, tc.firstDepositGMT AS firstDepositDate, DATEDIFF(DAY,tc.firstDepositGMT,GETDATE()) AS daysSinceFirstDeposit, tus.customerStatus AS accountStatus, gamewinAllCasino.customerRevenue AS lifetimeCasinoAccountingRevenue , CASE WHEN DATEDIFF(month,tc.firstPlayedNetentCasinoGMT,tc.lastPlayedNetentCasinoGMT) = 0 THEN gamewinAllCasino.customerRevenue ELSE (gamewinNetEnt.customerRevenue / DATEDIFF(month,tc.firstPlayedNetentCasinoGMT,tc.lastPlayedNetentCasinoGMT)) end AS averageCasinoAccountingRevenuePerActiveCasinoMonth, DepositAmt.pmtDepositAmount AS lifetimeDepositAmount FROM TDM..tcurrentCustomer tc (NOLOCK) inner join TDM..tcustomerState tus (NOLOCK) on tus.sk_customerState = tc.sk_customerState inner join TDM..tsegment vus (NOLOCK) on vus.segmentID = tc.currentSegmentID inner join TDM..tsegment vussub (NOLOCK) on vussub.segmentID = tc.currentSubSegmentID INNER JOIN tdw..tmerchant tm ON tm.sk_merchant = tc.sk_merchant INNER JOIN tdw..tbrand tb ON tc.sk_registerBrand = tb.sk_brand INNER JOIN tdw..tcustomerMarket cm ON cm.customerMarketID = tc.customerMarketID LEFT JOIN tdw..tcountry tcy ON tc.countryCode = tcy.CountryCode left join ( SELECT gs.sk_customer, gs.casinoModuleUserName from TDW..tgameStatNetentCasinoDaily gs inner join ( SELECT MAX(gs.calendarDateCET) lastcalendarDateCET, gs.sk_customer FROM TDW..tgameStatNetentCasinoDaily gs GROUP BY gs.sk_customer ) gs_un on gs.calendarDateCET = gs_un.lastcalendarDateCET and gs_un.sk_customer = gs.sk_customer WHERE gs.migrationSourceID = -1 AD-HOC QUERY
  • 3. Casino Campaigns – Retention AD-HOC QUERY ) temp ON temp.sk_customer = tc.sk_customer left join TDW..tcustomerProviderMapping cpm ON tc.sk_customer = cpm.sk_customer AND cpm.sk_provider = 1 left join ( select pgs.sk_customer, SUM(pgs.revenue_EUR) as customerRevenue, sum(pgs.bet_EUR) as lifetimeBet from tdm..tproviderGameStat pgs (NOLOCK) INNER JOIN tdw..tprovider tp ON pgs.sk_provider = tp.sk_provider WHERE tp.biProductID = 2 group by pgs.sk_customer ) gamewinAllCasino on tc.sk_customer = gamewinAllCasino.sk_customer left join ( select pgs.sk_customer, SUM(pgs.revenue_EUR) as customerRevenue, sum(pgs.bet_EUR) as lifetimeBet from tdm..tproviderGameStat pgs (NOLOCK) WHERE pgs.sk_provider = 1 group by pgs.sk_customer ) gamewinNetEnt on tc.sk_customer = gamewinNetEnt.sk_customer left join ( select ti.sk_customer, SUM(ti.pmtAmount_EUR) as pmtDepositAmount from tdm..tpmtTransactionInfo ti (NOLOCK) where ti.sk_pmtStatus in (2, 3) and ti.sk_pmtType = 1 group by ti.sk_customer ) DepositAmt on tc.sk_customer = DepositAmt.sk_customer WHERE tc.lastLoginGMT >= (DATEADD(d,-45,GETDATE())) AND (vus.segmentName IN ('NDC', 'SP', 'RP', 'IP', 'VIP1', 'VIP2', 'VIP3', 'VIP4', 'VIPN', 'NRC', 'VIP_POTENTIAL',) AND vussub.segmentName IN ('CASINO_CRY', 'CASINO_EVO', 'CASINO_GTS', 'CASINO_MGC', 'CASINO_NTN', 'CASINO_PNG, 'SPORT_CASINO', 'CASINO_POKER', 'POKER_CASINO', 'MULTIPRODUCTS')) AND tc.sk_registerBrand = 19 and tc.countryCode NOT IN ('BE','CA','CN','GR','MY','NL','PT','RO','UA')
  • 4. Casino Campaigns – Retention GET ISO WEEK CREATE FUNCTION [DBO].[fnGetIsoYearIsWeek] ( @THEDATE DATETIME ) RETURNS NVARCHAR(10) AS BEGIN DECLARE @MONTH INT, @WEEK INT SET @WEEK = DATEPART(ISOWK, @THEDATE) SET @MONTH = DATEPART(MONTH, @THEDATE) IF @WEEK = 53 AND @MONTH = 1 BEGIN RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, DATEADD(YEAR, -1, @THEDATE))) + ' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2) END IF @WEEK = 1 AND @MONTH = 12 BEGIN RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, DATEADD(YEAR, 1, @THEDATE))) + ' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2) END RETURN CONVERT(NVARCHAR(4), DATEPART(YEAR, @THEDATE)) + ' W.' + RIGHT('0'+ CONVERT(VARCHAR,DATEPART(ISOWK, @THEDATE)),2) END GET FIRST DAY OF MONTH CREATE FUNCTION [dbo].[ufn_GetFirstDayOfMonth] ( @pInputDate DATETIME ) RETURNS DATETIME BEGIN RETURN CAST(CAST(YEAR(@pInputDate) AS VARCHAR(4)) + '-' + CAST(MONTH(@pInputDate) AS VARCHAR(2)) + '-01' AS DATETIME) END GET LAST DAY OF MONTSELECT gs.sk_customer, CREATE FUNCTION [dbo].[ugs.casinoModuleUserName RETURNS DATETIME from TDW..tgameStatNetentCasinoDaily gs BEGIN inner join DECLARE ( SET @vOutputDate = SELECT MAX(gs.calendarDateCET) lastcalendarDateCET, SET @vOutputDate = gs.sk_customer RETURN @vOutputDateFROM TDW..tgameStatNetentCasinoDaily gs END UDF-Functions
  • 5. Casino Campaigns – Retention USE [TDM] GO CREATE PROCEDURE [dbo].[rpt_overview_report_Games_overview] @startDate datetime, @endDate datetime, @customerMarketID_List TEXT, @groupBy int = 0, @sk_customerType int = 1 -- User2 - Test User with recompile AS BEGIN CREATE TABLE #customerMarket ( customerMarketID INT ) INSERT INTO #customerMarket SELECT * FROM ProcessRepository..fnSplitText(@customerMarketID_List) s ------ SELECT ISNULL(gt.[gameType],'Not Classified') AS [gameType], g.gameName , CASE WHEN @groupBy = 0 THEN CONVERT(NVARCHAR(10), DATEADD(DAY, DATEDIFF(DAY, 0,gs.calendarDateCET), 0), 120) WHEN @groupBy = 1 THEN tdm.dbo.fnGetIsoYearIsoWeek(gs.calendarDateCET) WHEN @groupBy = 2 THEN CONVERT(NVARCHAR(4), DATEPART(YEAR, gs.calendarDateCET)) + '-' + RIGHT('0' + CONVERT(VARCHAR, DATEPART(MONTH, gs.calendarDateCET)),2) WHEN @groupBy = 3 THEN CONVERT(NVARCHAR(30), DATEADD(DAY,DATEDIFF(DAY, 0, @startDate),0), 112) + ' - '+ CONVERT(NVARCHAR(30), DATEADD(DAY, DATEDIFF(DAY, 0, @endDate), 0), 112) END AS period, SUM(gs.bet) AS Turnover , SUM(gs.win) AS Winings , COUNT(gs.sk_customer) AS count_ActiveCustomers FROM tgamestat gs INNER JOIN dbo.tgame g ON gs.gameID = g.gameID LEFT OUTER JOIN kufa88GameTypes gt ON gt.game = g.gameName INNER JOIN tdm..tcurrentCustomer cc (NOLOCK) ON gs.sk_customer = cc.sk_customer INNER JOIN #customerMarket cm ON cm.customerMarketID = cc.customerMarketID WHERE gs.calendarDateCET >= @startDate AND gs.calendarDateCET <= @endDate AND gs.gameID <> -1 --AND cc.sk_customerType = @sk_customerType -- both Regular and Test Users will be included GROUP BY gt.[gameType] , g.gameName , CASE WHEN @groupBy = 0 THEN CONVERT(NVARCHAR(10), DATEADD(DAY, DATEDIFF(DAY, 0,gs.calendarDateCET), 0), 120) WHEN @groupBy = 1 THEN tdm.dbo.fnGetIsoYearIsoWeek(gs.calendarDateCET) WHEN @groupBy = 2 SSRS-Report
  • 6. Casino Campaigns – Retention SSRS-Report THEN CONVERIGHT('0' + CONVERT(VARCHAR, DATEPART(MONTH, gs.calendarDateCET)),2) WHEN @groupBy = 3 THEN CONVECONVERT(NVARCHAR(30), DATEADD(DAY, DATEDIFF(DAY, 0, @endDate), 0), 112) END --------------------------------------- DROP TABLE #customerMarket END
  • 7. Casino Campaigns – Retention SSRS-Report