<commit_before>﻿CREATE VIEW [levy].[GetLevyDeclarations]
AS
SELECT 
	ld.Id AS Id,	
	ld.AccountId as AccountId,
	ld.empRef AS EmpRef,
	ld.SubmissionDate AS SubmissionDate,
	ld.SubmissionId AS SubmissionId,
	ld.SubmissionType AS SubmissionType,
	ld.Amount AS Amount,
	t.Amount AS EnglishFraction
FROM [levy].[LevyDeclaration] ld
OUTER APPLY
(
	SELECT TOP 1 Amount
	FROM [levy].[EnglishFraction] ef
	WHERE ef.EmpRef = ld.empRef 
		AND ef.[DateCalculated] <= ld.[SubmissionDate]
	ORDER BY [DateCalculated] DESC
) t<commit_msg>Temporary fix to view while new columns have been added<commit_after>﻿CREATE VIEW [levy].[GetLevyDeclarations]
AS
SELECT 
	ld.Id AS Id,	
	ld.AccountId as AccountId,
	ld.empRef AS EmpRef,
	ld.SubmissionDate AS SubmissionDate,
	ld.SubmissionId AS SubmissionId,
	ld.SubmissionType AS SubmissionType,
	ld.LevyDueYTD AS Amount,
	t.Amount AS EnglishFraction
FROM [levy].[LevyDeclaration] ld
OUTER APPLY
(
	SELECT TOP 1 Amount
	FROM [levy].[EnglishFraction] ef
	WHERE ef.EmpRef = ld.empRef 
		AND ef.[DateCalculated] <= ld.[SubmissionDate]
	ORDER BY [DateCalculated] DESC
) t
{'fraction_non_alphanumeric': 0.08990825688073395, 'fraction_numerical': 0.001834862385321101, 'mean_word_length': 4.929347826086956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2148068', 'n_tokens_mistral': 433, 'n_tokens_neox': 394, 'n_words': 112}