- Details
- Geschrieben von: Thorsten Böing
- Kategorie: Power BI - MDX & SQL
- Zugriffe: 107
Sammlung der wichtigsten SQL Befehle
https://1drv.ms/b/s!Ap5KnPXJl3aOg89CaZd1BTTp6tdBcg?e=r9Veer
- Details
- Geschrieben von: Thorsten Böing
- Kategorie: Power BI - MDX & SQL
- Zugriffe: 94
[TIMESTAMP] = TRY_CAST(substring([TIMESTAMP], 1, 19) as datetime)
- Details
- Geschrieben von: Thorsten Böing
- Kategorie: Power BI - MDX & SQL
- Zugriffe: 122
- Details
- Geschrieben von: Thorsten Böing
- Kategorie: Power BI - MDX & SQL
- Zugriffe: 112
SELECT [SourceSystem]
,[Client]
,[MaterialDocumentYear]
,[MovementType]
,[MaterialId]
,[PlantId]
,[StorageLocationId]
,[CurrencyId]
,[BaseUnitOfMeasure]
,Year = Year([DocumentPostingDate])
,Month = Month([DocumentPostingDate])
, #Pos = count([MaterialDocumentId])
, Quantity = sum([Quantity])
, Value = sum([AmountLocalCurrency])
FROM [VartaDataWarehouse].[fct].[MaterialDocumentSegment]
WHERE [SourceSystem] = 'M' and [StorageLocationId] <> '' -- and [DocumentPostingDate] >= '2021-01-01'
GROUP BY [SourceSystem]
,[Client]
,[MaterialDocumentYear]
,[MovementType]
,[MaterialId]
,[PlantId]
,[StorageLocationId]
,[CurrencyId]
,[BaseUnitOfMeasure]
,Year([DocumentPostingDate])
,Month([DocumentPostingDate])
- Details
- Geschrieben von: Thorsten Böing
- Kategorie: Power BI - MDX & SQL
- Zugriffe: 125
ISNULL(DocumentPostingDate, CAST(CONCAT(MaterialDocumentYear, '-12-31') AS Date)) AS DocumentPostingDate
SELECT [SourceSystem]
,[Client],[MaterialDocumentId],[MaterialDocumentYear],[Line],[MovementType],[MaterialId],[PlantId],[StorageLocationId],[BatchNumber],[StockTypeId],[SpecialStock]
,[SupplierId],[CustomerId],[SalesOrderNumberId],[SalesOrderItem],[DeliveryScheduleForSalesOrder],[DebitCredit],[CurrencyId],[AmountLocalCurrency],[ValuationType]
,[Quantity],[BaseUnitOfMeasure],[PurchasingDocumentId],[PurchasingDocumentItem],[ReferenceDocumentId],[ReferenceDocumentItem],[DeliveryCompletedIndicator]
,[ItemText],[EquipmentNumber],[ShipToPartyId],[UnloadingPoint],[CostCenterId],[ProjectNumberOld],[OrderNumber],[CompanyId],[ReceivingIssuingMaterialId]
,[ReceivingIssuingPlantId],[ReceivingIssuingStorageLocationId],[ReceivingIssuingBatch],[ValuationTypeOfTransferBatch],[SpecialStockIndicatorForPhysicalStockTransfer]
,[MovementIndicatorId],[MovementTypeForWarehouseManagement],[GLAccountId]
,ISNULL(DocumentPostingDate, CAST(CONCAT(MaterialDocumentYear, '-12-31') AS Date)) AS DocumentPostingDate
,[DeliveryId],[DeliveryItem],[StgCreateDate],[StgChangeDate]
FROM [VartaDataWarehouse].[fct].[MaterialDocumentSegment]
WHERE SourceSystem = 'M'