1
0
forked from s26450/hurtownia

Compare commits

..

13 Commits

Author SHA1 Message Date
55bd2b82e4 slowly chaning dimension 2019-02-03 16:50:10 +01:00
15ad3c8df2 incremental loading 2019-01-27 14:55:23 +01:00
Mariusz Sielski
d6c1eb612a ddd 2019-01-27 14:04:28 +01:00
Mariusz Sielski
3f4c773d91 lal e; 2019-01-27 13:58:14 +01:00
Mariusz Sielski
ddec9adfa4 skrypt 2019-01-27 13:06:44 +01:00
Mariusz Sielski
37cc132e32 facetowanie 2019-01-27 12:34:59 +01:00
98c8030072 update 2019-01-26 15:08:43 +01:00
6354f6861c fix cnt 2019-01-24 18:07:58 +01:00
bd63205271 load facts 2019-01-23 18:34:40 +01:00
04a2640826 Merge branch 'master' of git.wmi.amu.edu.pl:s26450/hurtownia 2019-01-22 21:35:20 +01:00
e1785ac40c update create and add mappings excel 2019-01-22 21:35:15 +01:00
d37da03c51 Zaktualizuj 'sql/create.sql' 2019-01-22 20:27:06 +00:00
c9e4b03ed5 update create 2019-01-12 09:52:01 +01:00
28 changed files with 54395 additions and 12 deletions

View File

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts"
DTS:refId="Package"
DTS:CreationDate="1/12/2019 10:07:44 AM"
DTS:CreationName="Microsoft.Package"
DTS:CreatorComputerName="PCD3O"
DTS:CreatorName="LABS\s26450"
DTS:DTSID="{ABEF96BA-820C-43C9-A338-2E71F6380CDA}"
DTS:ExecutableType="Microsoft.Package"
DTS:LastModifiedProductVersion="14.0.0800.60"
DTS:LocaleID="1045"
DTS:ObjectName="Facts"
DTS:PackageType="5"
DTS:VersionBuild="1"
DTS:VersionGUID="{CC2E3A9C-4775-4BC0-BBDD-0F04AFD1F4B1}">
<DTS:Property
DTS:Name="PackageFormatVersion">8</DTS:Property>
<DTS:Variables />
<DTS:Executables />
<DTS:DesignTimeProperties><![CDATA[<?xml version="1.0"?>
<!--This CDATA section contains the layout information of the package. The section includes information such as (x,y) coordinates, width, and height.-->
<!--If you manually edit this section and make a mistake, you can delete it. -->
<!--The package will still be able to load normally but the previous layout information will be lost and the designer will automatically re-arrange the elements on the design surface.-->
<Objects
Version="8">
<!--Each node below will contain properties that do not affect runtime behavior.-->
</Objects>]]></DTS:DesignTimeProperties>
</DTS:Executable>

View File

@ -0,0 +1,13 @@
<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0" dwd:design-time-name="d5b2683a-0d73-4cfb-ab80-6c2316a84794" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ID>Load Facts</ID>
<Name>Load Facts</Name>
<CreatedTimestamp>0001-01-01T00:00:00Z</CreatedTimestamp>
<LastSchemaUpdate>0001-01-01T00:00:00Z</LastSchemaUpdate>
<LastProcessed>0001-01-01T00:00:00Z</LastProcessed>
<State>Unprocessed</State>
<LastUpdate>0001-01-01T00:00:00Z</LastUpdate>
<DataSourceImpersonationInfo>
<ImpersonationMode>Default</ImpersonationMode>
<ImpersonationInfoSecurity>Unchanged</ImpersonationInfoSecurity>
</DataSourceImpersonationInfo>
</Database>

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DeploymentModel>Project</DeploymentModel>
<ProductVersion>14.0.800.60</ProductVersion>
<SchemaVersion>9.0.1.0</SchemaVersion>
<State>$base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==</State>
<Database>
<Name>Load Facts.database</Name>
<FullPath>Load Facts.database</FullPath>
</Database>
<DataSources />
<DataSourceViews />
<DeploymentModelSpecificContent>
<Manifest>
<SSIS:Project SSIS:ProtectionLevel="EncryptSensitiveWithUserKey" xmlns:SSIS="www.microsoft.com/SqlServer/SSIS">
<SSIS:Properties>
<SSIS:Property SSIS:Name="ID">{3485865b-1c8e-4315-a04e-78a25dd9cb67}</SSIS:Property>
<SSIS:Property SSIS:Name="Name">Load Facts</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMajor">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMinor">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionComments">
</SSIS:Property>
<SSIS:Property SSIS:Name="CreationDate">2019-01-12T10:07:44.0021233+01:00</SSIS:Property>
<SSIS:Property SSIS:Name="CreatorName">LABS\s26450</SSIS:Property>
<SSIS:Property SSIS:Name="CreatorComputerName">PCD3O</SSIS:Property>
<SSIS:Property SSIS:Name="Description">
</SSIS:Property>
<SSIS:Property SSIS:Name="PasswordVerifier" SSIS:Sensitive="1">AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA2/gF7PgcGUiQRVKKmMpSyQAAAAACAAAAAAADZgAAwAAAABAAAAAXRRvHiGqih8dGsgN6pLFCAAAAAASAAACgAAAAEAAAAI9Ja5QPbTHXUEyn5rL91IiIAAAAttcNqd0308CUyaTyab0lzLuyGh8HbuP3p5FbESNqRdIkGK28dW7AAvhGievGaGqB/3NCEz7Xf0d7fFPgolXfC1VPfdnO04NRSKKUeRKzZhoaPIotGiqCsZ+3+HKZNNWJ0TxGWT+/eL+f3o7MIF0G9AuJqnkMYCxax+oZPxJ2f3NCZyIo29LufxQAAADHq6eLATgfTd1l4hG4UQju98OC0g==</SSIS:Property>
<SSIS:Property SSIS:Name="FormatVersion">1</SSIS:Property>
</SSIS:Properties>
<SSIS:Packages>
<SSIS:Package SSIS:Name="Facts.dtsx" SSIS:EntryPoint="1" />
</SSIS:Packages>
<SSIS:ConnectionManagers />
<SSIS:DeploymentInfo>
<SSIS:ProjectConnectionParameters />
<SSIS:PackageInfo>
<SSIS:PackageMetaData SSIS:Name="Facts.dtsx">
<SSIS:Properties>
<SSIS:Property SSIS:Name="ID">{ABEF96BA-820C-43C9-A338-2E71F6380CDA}</SSIS:Property>
<SSIS:Property SSIS:Name="Name">Facts</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMajor">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMinor">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionComments">
</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{CC2E3A9C-4775-4BC0-BBDD-0F04AFD1F4B1}</SSIS:Property>
<SSIS:Property SSIS:Name="PackageFormatVersion">8</SSIS:Property>
<SSIS:Property SSIS:Name="Description">
</SSIS:Property>
<SSIS:Property SSIS:Name="ProtectionLevel">1</SSIS:Property>
</SSIS:Properties>
<SSIS:Parameters />
</SSIS:PackageMetaData>
</SSIS:PackageInfo>
</SSIS:DeploymentInfo>
</SSIS:Project>
</Manifest>
</DeploymentModelSpecificContent>
<ControlFlowParts />
<Miscellaneous />
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<OutputPath>bin</OutputPath>
<ConnectionMappings />
<ConnectionProviderMappings />
<ConnectionSecurityMappings />
<DatabaseStorageLocations />
<TargetServerVersion>SQLServer2017</TargetServerVersion>
<ParameterConfigurationValues />
</Options>
</Configuration>
</Configurations>
</Project>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<DataTransformationsUserConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<UserIDs />
<UserPasswords />
<OfflineMode>false</OfflineMode>
<ProgressReporting>true</ProgressReporting>
<ParameterConfigurationSensitiveValues />
</Options>
</Configuration>
</Configurations>
</DataTransformationsUserConfiguration>

View File

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<SSIS:Parameters xmlns:SSIS="www.microsoft.com/SqlServer/SSIS" />

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.15
MinimumVisualStudioVersion = 10.0.40219.1
Project("{159641D6-6404-4A2A-AE62-294DE0FE8301}") = "Poczatki2018-11-18", "Poczatki2018-11-18\Poczatki2018-11-18.dtproj", "{A41F0BF7-BA30-42B5-B1D5-255E790E0269}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Development|Default = Development|Default
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A41F0BF7-BA30-42B5-B1D5-255E790E0269}.Development|Default.ActiveCfg = Development
{A41F0BF7-BA30-42B5-B1D5-255E790E0269}.Development|Default.Build.0 = Development
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E2978AD8-B78A-47C5-A57D-F708DC59A19D}
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
<?xml version="1.0"?>
<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts"
DTS:refId="Package"
DTS:CreationDate="2/3/2019 4:29:27 PM"
DTS:CreationName="Microsoft.Package"
DTS:CreatorComputerName="TERM2"
DTS:CreatorName="LABS\s26450"
DTS:DTSID="{BBC28B72-E01F-48A7-909B-553A8213CE17}"
DTS:ExecutableType="Microsoft.Package"
DTS:LastModifiedProductVersion="14.0.0800.60"
DTS:LocaleID="1045"
DTS:ObjectName="Initialize"
DTS:PackageType="5"
DTS:VersionBuild="2"
DTS:VersionGUID="{744A5C7B-5F44-40BD-BFE1-E352091F81A3}">
<DTS:Property
DTS:Name="PackageFormatVersion">8</DTS:Property>
<DTS:ConnectionManagers>
<DTS:ConnectionManager
DTS:refId="Package.ConnectionManagers[create.sql]"
DTS:CreationName="FILE"
DTS:DTSID="{84AD08A2-8BC4-448B-A5EE-F3D04B1E6204}"
DTS:ObjectName="create.sql">
<DTS:ObjectData>
<DTS:ConnectionManager
DTS:ConnectionString="J:\source\repos\hurtowania_roche\sql\create.sql" />
</DTS:ObjectData>
</DTS:ConnectionManager>
<DTS:ConnectionManager
DTS:refId="Package.ConnectionManagers[mysql-2016]"
DTS:CreationName="OLEDB"
DTS:DTSID="{1A97203D-DEEB-4A41-A636-F990CD3EF8CF}"
DTS:ObjectName="mysql-2016">
<DTS:ObjectData>
<DTS:ConnectionManager
DTS:ConnectionString="Data Source=mssql-2016.labs.wmi.amu.edu.pl;Initial Catalog=bigdata_s26450;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;" />
</DTS:ObjectData>
</DTS:ConnectionManager>
</DTS:ConnectionManagers>
<DTS:Variables />
<DTS:Executables>
<DTS:Executable
DTS:refId="Package\Execute SQL Task"
DTS:CreationName="Microsoft.ExecuteSQLTask"
DTS:Description="Execute SQL Task"
DTS:DTSID="{90BC1163-60A9-4480-80B8-0CB8BAAF98DE}"
DTS:ExecutableType="Microsoft.ExecuteSQLTask"
DTS:LocaleID="-1"
DTS:ObjectName="Execute SQL Task"
DTS:TaskContact="Execute SQL Task; Microsoft Corporation; SQL Server 2017 RC1; © 2017 Microsoft Corporation; All Rights Reserved;http://www.microsoft.com/sql/support/default.asp;1"
DTS:ThreadHint="0">
<DTS:Variables />
<DTS:ObjectData>
<SQLTask:SqlTaskData
SQLTask:Connection="{1A97203D-DEEB-4A41-A636-F990CD3EF8CF}"
SQLTask:SqlStmtSourceType="FileConnection"
SQLTask:SqlStatementSource="create.sql" xmlns:SQLTask="www.microsoft.com/sqlserver/dts/tasks/sqltask" />
</DTS:ObjectData>
</DTS:Executable>
</DTS:Executables>
<DTS:DesignTimeProperties><![CDATA[<?xml version="1.0"?>
<!--This CDATA section contains the layout information of the package. The section includes information such as (x,y) coordinates, width, and height.-->
<!--If you manually edit this section and make a mistake, you can delete it. -->
<!--The package will still be able to load normally but the previous layout information will be lost and the designer will automatically re-arrange the elements on the design surface.-->
<Objects
Version="8">
<!--Each node below will contain properties that do not affect runtime behavior.-->
<Package
design-time-name="Package">
<LayoutInfo>
<GraphLayout
Capacity="4" xmlns="clr-namespace:Microsoft.SqlServer.IntegrationServices.Designer.Model.Serialization;assembly=Microsoft.SqlServer.IntegrationServices.Graph">
<NodeLayout
Size="162.4,41.6"
Id="Package\Execute SQL Task"
TopLeft="171.428574347983,125.411766464735" />
</GraphLayout>
</LayoutInfo>
</Package>
</Objects>]]></DTS:DesignTimeProperties>
</DTS:Executable>

View File

@ -0,0 +1,13 @@
<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400" xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500" xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500" xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0" dwd:design-time-name="b48a0644-77ae-4296-9362-23df6b63465e" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ID>Poczatki2018-11-18</ID>
<Name>Poczatki2018-11-18</Name>
<CreatedTimestamp>0001-01-01T00:00:00Z</CreatedTimestamp>
<LastSchemaUpdate>0001-01-01T00:00:00Z</LastSchemaUpdate>
<LastProcessed>0001-01-01T00:00:00Z</LastProcessed>
<State>Unprocessed</State>
<LastUpdate>0001-01-01T00:00:00Z</LastUpdate>
<DataSourceImpersonationInfo>
<ImpersonationMode>Default</ImpersonationMode>
<ImpersonationInfoSecurity>Unchanged</ImpersonationInfoSecurity>
</DataSourceImpersonationInfo>
</Database>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<DataTransformationsUserConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<UserIDs />
<UserPasswords />
<OfflineMode>false</OfflineMode>
<ProgressReporting>true</ProgressReporting>
<ParameterConfigurationSensitiveValues>
<ConfigurationSetting>
<Id>LastModifiedTime</Id>
<Name>LastModifiedTime</Name>
<Value xsi:type="xsd:dateTime">2018-11-18T14:10:17.4623642Z</Value>
</ConfigurationSetting>
</ParameterConfigurationSensitiveValues>
</Options>
</Configuration>
</Configurations>
</DataTransformationsUserConfiguration>

View File

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<SSIS:Parameters xmlns:SSIS="www.microsoft.com/SqlServer/SSIS" />

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<BuildLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ProjectInfo>
<Name>Poczatki2018-11-18</Name>
<LastWriteTime>2019-02-03T15:40:02.2388641Z</LastWriteTime>
<LastKnownProtectionLevel>EncryptSensitiveWithUserKey</LastKnownProtectionLevel>
</ProjectInfo>
<LastBuildInfos>
<ProjectBuildItemInfo>
<Name>Facts.dtsx</Name>
<LastWriteTime>2019-02-03T15:48:03.86571Z</LastWriteTime>
<LastKnownProtectionLevel>EncryptSensitiveWithUserKey</LastKnownProtectionLevel>
</ProjectBuildItemInfo>
<ProjectBuildItemInfo>
<Name>Dims.dtsx</Name>
<LastWriteTime>2019-02-03T15:44:10.9173518Z</LastWriteTime>
<LastKnownProtectionLevel>EncryptSensitiveWithUserKey</LastKnownProtectionLevel>
</ProjectBuildItemInfo>
<ProjectBuildItemInfo>
<Name>Initialize.dtsx</Name>
<LastWriteTime>2019-02-03T15:31:58.219104Z</LastWriteTime>
<LastKnownProtectionLevel>EncryptSensitiveWithUserKey</LastKnownProtectionLevel>
</ProjectBuildItemInfo>
</LastBuildInfos>
</BuildLog>

View File

@ -0,0 +1,81 @@
<?xml version="1.0"?>
<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts"
DTS:refId="Package"
DTS:CreationDate="2/3/2019 4:29:27 PM"
DTS:CreationName="Microsoft.Package"
DTS:CreatorComputerName="TERM2"
DTS:CreatorName="LABS\s26450"
DTS:DTSID="{BBC28B72-E01F-48A7-909B-553A8213CE17}"
DTS:ExecutableType="Microsoft.Package"
DTS:LastModifiedProductVersion="14.0.0800.60"
DTS:LocaleID="1045"
DTS:ObjectName="Initialize"
DTS:PackageType="5"
DTS:VersionBuild="2"
DTS:VersionGUID="{744A5C7B-5F44-40BD-BFE1-E352091F81A3}">
<DTS:Property
DTS:Name="PackageFormatVersion">8</DTS:Property>
<DTS:ConnectionManagers>
<DTS:ConnectionManager
DTS:refId="Package.ConnectionManagers[create.sql]"
DTS:CreationName="FILE"
DTS:DTSID="{84AD08A2-8BC4-448B-A5EE-F3D04B1E6204}"
DTS:ObjectName="create.sql">
<DTS:ObjectData>
<DTS:ConnectionManager
DTS:ConnectionString="J:\source\repos\hurtowania_roche\sql\create.sql" />
</DTS:ObjectData>
</DTS:ConnectionManager>
<DTS:ConnectionManager
DTS:refId="Package.ConnectionManagers[mysql-2016]"
DTS:CreationName="OLEDB"
DTS:DTSID="{1A97203D-DEEB-4A41-A636-F990CD3EF8CF}"
DTS:ObjectName="mysql-2016">
<DTS:ObjectData>
<DTS:ConnectionManager
DTS:ConnectionString="Data Source=mssql-2016.labs.wmi.amu.edu.pl;Initial Catalog=bigdata_s26450;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;" />
</DTS:ObjectData>
</DTS:ConnectionManager>
</DTS:ConnectionManagers>
<DTS:Variables />
<DTS:Executables>
<DTS:Executable
DTS:refId="Package\Execute SQL Task"
DTS:CreationName="Microsoft.ExecuteSQLTask"
DTS:Description="Execute SQL Task"
DTS:DTSID="{90BC1163-60A9-4480-80B8-0CB8BAAF98DE}"
DTS:ExecutableType="Microsoft.ExecuteSQLTask"
DTS:LocaleID="-1"
DTS:ObjectName="Execute SQL Task"
DTS:TaskContact="Execute SQL Task; Microsoft Corporation; SQL Server 2017 RC1; © 2017 Microsoft Corporation; All Rights Reserved;http://www.microsoft.com/sql/support/default.asp;1"
DTS:ThreadHint="0">
<DTS:Variables />
<DTS:ObjectData>
<SQLTask:SqlTaskData
SQLTask:Connection="{1A97203D-DEEB-4A41-A636-F990CD3EF8CF}"
SQLTask:SqlStmtSourceType="FileConnection"
SQLTask:SqlStatementSource="create.sql" xmlns:SQLTask="www.microsoft.com/sqlserver/dts/tasks/sqltask" />
</DTS:ObjectData>
</DTS:Executable>
</DTS:Executables>
<DTS:DesignTimeProperties><![CDATA[<?xml version="1.0"?>
<!--This CDATA section contains the layout information of the package. The section includes information such as (x,y) coordinates, width, and height.-->
<!--If you manually edit this section and make a mistake, you can delete it. -->
<!--The package will still be able to load normally but the previous layout information will be lost and the designer will automatically re-arrange the elements on the design surface.-->
<Objects
Version="8">
<!--Each node below will contain properties that do not affect runtime behavior.-->
<Package
design-time-name="Package">
<LayoutInfo>
<GraphLayout
Capacity="4" xmlns="clr-namespace:Microsoft.SqlServer.IntegrationServices.Designer.Model.Serialization;assembly=Microsoft.SqlServer.IntegrationServices.Graph">
<NodeLayout
Size="162.4,41.6"
Id="Package\Execute SQL Task"
TopLeft="171.428574347983,125.411766464735" />
</GraphLayout>
</LayoutInfo>
</Package>
</Objects>]]></DTS:DesignTimeProperties>
</DTS:Executable>

View File

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<SSIS:Parameters xmlns:SSIS="www.microsoft.com/SqlServer/SSIS" />

View File

@ -248,3 +248,4 @@ Western Sahara EH ESH 732
Yemen YE YEM 887 Yemen YE YEM 887
Zambia ZM ZMB 894 Zambia ZM ZMB 894
Zimbabwe ZW ZWE 716 Zimbabwe ZW ZWE 716
Kosowo XK XKX -220
1 English short name Alpha-2 code Alpha-3 code Numeric
248 Yemen YE YEM 887
249 Zambia ZM ZMB 894
250 Zimbabwe ZW ZWE 716
251 Kosowo XK XKX -220

View File

@ -7,4 +7,4 @@ AAR5 Fasecon Argentina
AAS6 Physdax Switzerland AAS6 Physdax Switzerland
AAT7 Ronhow Switzerland AAT7 Ronhow Switzerland
AAU8 Medzoom China AAU8 Medzoom China
AAW9 ACNE France AAW9 ACNE Poland

1 AAM0 Zapcode United States
7 AAS6 Physdax Switzerland
8 AAT7 Ronhow Switzerland
9 AAU8 Medzoom China
10 AAW9 ACNE France Poland

BIN
mapping.xlsx Normal file

Binary file not shown.

7714
not_found.csv Normal file

File diff suppressed because it is too large Load Diff

BIN
not_found.xls Normal file

Binary file not shown.

85
raportowanie.r Normal file
View File

@ -0,0 +1,85 @@
require(odbc)
require(dbplyr)
require(dplyr)
require(tidyr)
require(ggplot2)
con <- DBI::dbConnect(
odbc::odbc(),
.connection_string = 'driver={SQL Server};server=mssql-2016.labs.wmi.amu.edu.pl;database=bigdata_s26450;trusted_connection=true')
countries <- tbl(con, "dim_countries")
drugs <- tbl(con, "dim_drugs")
time <- tbl(con, "dim_time")
status <- tbl(con, "dim_claim_statuses")
# Zaakceptowane i odrzuconce refundacje w latach
tbl(con, "FT_Refund") %>%
inner_join(time, by = c("response_time_fk" = "time_sk")) %>%
inner_join(status, by = c("claim_status_fk" = "claim_status_sk")) %>%
filter(year >= 2008 && year <= 2016) %>%
group_by(year, status_description) %>%
summarize(how_many = sum(cnt)) %>%
ungroup() %>%
ggplot(aes(year, how_many, fill = status_description)) +
geom_bar(stat = "identity") +
scale_x_continuous(breaks = 2009:2016) +
facet_grid(. ~ status_description)
tbl(con, "FT_Refund") %>%
inner_join(time, by = c("response_time_fk" = "time_sk")) %>%
inner_join(status, by = c("claim_status_fk" = "claim_status_sk")) %>%
filter(year >= 2008 && year <= 2016) %>%
group_by(year, status_description) %>%
summarize(how_many = sum(cnt)) %>%
ungroup() %>%
ggplot(aes(year, how_many, fill = status_description)) +
geom_bar(stat = "identity", position = "dodge") +
geom_text(aes(label = how_many)) +
scale_x_continuous(breaks = 2009:2016) +
ylab("count")
tbl(con, "FT_Refund") %>%
inner_join(countries, by = c("country_fk" = "country_sk")) %>%
inner_join(drugs, by = c("drug_fk" = "drug_sk")) %>%
head(n = 500) %>%
ggplot(aes(price, reimbursement_amountPercent, color = country_name)) +
geom_point() +
xlab("Cena") +
ylab("% zniki")
tbl(con, "FT_Refund") %>%
inner_join(time, by = c("response_time_fk" = "time_sk")) %>%
inner_join(drugs, by = c("drug_fk" = "drug_sk")) %>%
filter(year %in% c(2009, 2010)) %>%
mutate(sale = ifelse(reimbursement_amountPercent > 30, "on sale", "not on sale")) %>%
ggplot(aes(month, price, fill = drug_product_family_name)) +
geom_bar(stat = "identity") +
scale_x_continuous("month", breaks = 1:12) +
facet_grid(sale ~ year)
registration_decades <- tbl(con, "FT_Registration") %>%
inner_join(time, by = c("submission_date_fk" = "time_sk")) %>%
inner_join(status, by = c("claim_status_fk" = "claim_status_sk")) %>%
mutate(decade = floor(year / 10) * 10, got_answer = status_code_bk != "W") %>%
filter(decade < 2020, decade >= 1980)
with_grouping_by_answer <- registration_decades %>%
group_by(decade) %>%
summarize(how_many = sum(cnt))
registration_decades %>%
group_by(decade, got_answer) %>%
summarize(how_many = sum(cnt)) %>%
filter(how_many > 0) %>%
ggplot(aes(decade, how_many, fill = got_answer)) +
geom_bar(stat = "identity") +
geom_label(aes(label = how_many)) +
geom_label(data = with_grouping_by_answer, aes(y = how_many, label = how_many, fill = NULL))

View File

@ -6,7 +6,8 @@ CREATE TABLE dim_factories (
factory_sk INTEGER identity(1,1) PRIMARY KEY, factory_sk INTEGER identity(1,1) PRIMARY KEY,
factory_bk NVARCHAR(100) NOT NULL, factory_bk NVARCHAR(100) NOT NULL,
factory_name NVARCHAR(250), factory_name NVARCHAR(250),
factory_country NVARCHAR(250) factory_country NVARCHAR(250),
is_historical TINYINT DEFAULT(0)
); );
GO GO
@ -59,8 +60,8 @@ WHILE @FromDate <= @ToDate
SELECT SELECT
@FromDate as time_bk, @FromDate as time_bk,
convert(nvarchar(10), @FromDate,20) AS time_string, convert(nvarchar(10), @FromDate,20) AS time_string,
MONTH(@FromDate) AS [month],
YEAR(@FromDate) AS [year], YEAR(@FromDate) AS [year],
MONTH(@FromDate) AS [month],
DAY(@FromDate) AS [day], DAY(@FromDate) AS [day],
DATENAME(QUARTER,@FromDate) AS [quarter] DATENAME(QUARTER,@FromDate) AS [quarter]
SET @FromDate = DATEADD(DAY, 1, @FromDate) SET @FromDate = DATEADD(DAY, 1, @FromDate)
@ -87,7 +88,7 @@ GO
DROP TABLE IF EXISTS dim_drugs; DROP TABLE IF EXISTS dim_drugs;
CREATE TABLE dim_drugs ( CREATE TABLE dim_drugs (
drug_sk INTEGER identity(1, 1) PRIMARY KEY, drug_sk INTEGER identity(1, 1) PRIMARY KEY,
drug_product_id_bk INTEGER NOT NULL, -- business key drug_product_id_bk NVARCHAR(13) NOT NULL, -- business key
record_status CHAR(1), -- A for active, D for deactivated record_status CHAR(1), -- A for active, D for deactivated
drug_product_name NVARCHAR(250), drug_product_name NVARCHAR(250),
ro_number NVARCHAR(20), ro_number NVARCHAR(20),
@ -106,7 +107,7 @@ CREATE TABLE dim_countries (
DROP TABLE IF EXISTS dim_claim_statuses; DROP TABLE IF EXISTS dim_claim_statuses;
CREATE TABLE dim_claim_statuses ( CREATE TABLE dim_claim_statuses (
claim_status_sk INTEGER identity(1, 1) PRIMARY KEY, claim_status_sk INTEGER identity(1, 1) PRIMARY KEY,
status_code_bk VARCHAR(1) NOT NULL, -- A for Accepted, D for Declined, W for Waiting status_code_bk NVARCHAR(1) NOT NULL, -- A for Accepted, D for Declined, W for Waiting
status_description NVARCHAR(50) status_description NVARCHAR(50)
); );
GO GO
@ -121,8 +122,8 @@ GO
DROP TABLE IF EXISTS claim_status_mapping; DROP TABLE IF EXISTS claim_status_mapping;
CREATE TABLE claim_status_mapping ( CREATE TABLE claim_status_mapping (
status_code_bk VARCHAR(1), status_code_bk NVARCHAR(1),
status_code_value VARCHAR(50) status_code_value NVARCHAR(50)
); );
GO GO
@ -153,9 +154,9 @@ CREATE TABLE FT_Registration (
--claim status do uspójnienia z tabelą dim_status, wydaje mi się, że można by dodać przedrostek claim do kolumn, będzie czytelniej :) --claim status do uspójnienia z tabelą dim_status, wydaje mi się, że można by dodać przedrostek claim do kolumn, będzie czytelniej :)
claim_status_fk integer FOREIGN KEY REFERENCES dim_claim_statuses(claim_status_sk) NOT NULL, claim_status_fk integer FOREIGN KEY REFERENCES dim_claim_statuses(claim_status_sk) NOT NULL,
indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL, indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL,
claim_number NVARCHAR(50), claim_number VARCHAR(20),
-- cnt jest tylko zliczeniowy, będzie miał 1, więc dałbym tinyint -- cnt jest tylko zliczeniowy, będzie miał 1, więc dałbym tinyint
cnt tinyint, cnt tinyint DEFAULT(1)
); );
GO GO
@ -168,13 +169,12 @@ CREATE TABLE FT_Refund (
response_time_fk integer FOREIGN KEY REFERENCES dim_time(time_sk), -- moze byc null response_time_fk integer FOREIGN KEY REFERENCES dim_time(time_sk), -- moze byc null
country_fk integer FOREIGN KEY REFERENCES dim_countries(country_sk) NOT NULL, country_fk integer FOREIGN KEY REFERENCES dim_countries(country_sk) NOT NULL,
indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL, indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk) NOT NULL,
registration_country_fk integer FOREIGN KEY REFERENCES dim_countries(country_sk) NOT NULL,
--decimal zjada mniej, niż money, do przedyskutowania (precyzja - liczba miejsc przed i po przecinku, skala - liczba miejsc po przecinku) --decimal zjada mniej, niż money, do przedyskutowania (precyzja - liczba miejsc przed i po przecinku, skala - liczba miejsc po przecinku)
price money, price money,
reimbursement_amountPercent smallint, reimbursement_amountPercent smallint,
--tu obliczymy jako iloczyn price * reimbursement_amountPercent --tu obliczymy jako iloczyn price * reimbursement_amountPercent
reimbursement_amount decimal(9,2), reimbursement_amount decimal(9,2),
claim_number integer, claim_number VARCHAR(20),
cnt tinyint, cnt tinyint DEFAULT(1)
); );
GO GO