Professional Documents
Culture Documents
FY21 Azure Direct SQL Query
FY21 Azure Direct SQL Query
SELECT a.[TPID]
,[FiscalYearQuarter]
,[Date] as [Fiscal Month]
,o.[OrgName] as [Account Name]
,[FiscalYear]
,[TotalEffectiveBilling] as [Azure Consumed Revenue]
,[RegistrationStatus]
,case when g.[Area] is null then b.Country else g.Country end as Country
FROM [PhilanthropyDataFeeds].[vw_AzureRevenue] a
LEFT JOIN [PhilanthropyDataFeeds].[vw_CalendarDate] ON [billingmonthDImDateKey]=[Date]
Left JOIN [PhilanthropyDataFeeds].[vw_AzureRegistrations] d ON a.[RegistrationID]=d.
[Registrationid]
LEFT JOIN [PhilanthropyDataFeeds].[vw_nonprofit] o ON d.[Registrationnumber]=o.
[RegistrationNumber]
LEFT JOIN [PhilanthropyDataFeeds].[vw_StaticGeography] g ON
[CountryCustom]=o.OrgCountry
LEFT JOIN #BlankAreas b ON a.TPID=b.TPID