Das ist mein Check Code: ### CHECK 1 ###
#CHECK 1.1
CHECK_Schadenreserve_KLV_LF1 <- read_excel(path_excel_klv, sheet = "Schadenres einzelvertr LF KLV 1")
KLV_sum1 <- sum(CHECK_Schadenreserve_KLV_LF1$Schadenreserve)
check_1.1 <- all.equal(KLV_sum1, sum(Schadenreserve_KLV_LF1$Schadenreserve))
#CHECK 1.2
CHECK_Schadenreserve_KLV_LF2 <- read_excel(path_excel_klv, sheet = "Schadenres einzelvertr LF KLV 2")
KLV_sum2 <- sum(CHECK_Schadenreserve_KLV_LF2$Schadenreserve)
check_1.2 <- all.equal(KLV_sum2, sum(Schadenreserve_KLV_LF2$Schadenreserve))
#CHECK 1.3
CHECK_Schadenreserve_KLV_RAI <- read_excel(path_excel_klv, sheet = "Schadenres einzelvertr RAI")
KLV_sum3 <- sum(CHECK_Schadenreserve_KLV_RAISRvertr)+sum(CHECKSchadenreserveKLVRASR_Gew)
check_1.3 <- all.equal(KLV_sum3,sum(Schadenreserve_KLV_RAI$Schadenreserve))
#CHECK 1.4
CHECK_Schadenreserve_KLV_SUL <- read_excel(path_excel_klv, sheet = "Schadenres einzelvertr SUL")
KLV_sum4 <- sum(CHECK_Schadenreserve_KLV_SULSRVertr)+sum(CHECSR_Gew)
check_1.4 <- all.equal(KLV_sum4,sum(Schadenreserve_KLV_SUL$Schadenreserve))
#CHECK 1.5
sum_Schadenreserve_KLV <- KLV_sum1 + KLV_sum2 + KLV_sum3 + KLV_sum4
check_1.5 <- all.equal(sum_Schadenreserve_KLV,sum(Schadenreserve_KLV$Schadenreserve))
CHECK 2
#CHECK 2.1
CHECK_Schadenreserve_FLV_INAS1 <- read_excel(path_excel_flv, sheet = "Todesfaelle")
FLV_sum1 <- sum(CHECK_Schadenreserve_FLV_INAS1$"Stand Reserve\r\n31.03.2024")
check_2.1 <- all.equal(FLV_sum1,sum(Schadenreserve_FLV_INAS1$Schadenreserve))
#CHECK 2.2
CHECK_Schadenreserve_FLV_INAS2 <- read_excel(path_excel_flv, sheet = "L62ohneL61")
FLV_sum2 <- sum(CHECK_Schadenreserve_FLV_INAS2$"Stand Reserve\r\n31.03.2024")
check_2.2 <- all.equal(FLV_sum2, sum(Schadenreserve_FLV_INAS2$Schadenreserve))
#CHECK 2.3
CHECK_Schadenreserve_FLV_INAS3 <- read_excel(path_excel_flv, sheet = "OP Liste")
FLV_sum3 <- sum(CHECK_Schadenreserve_FLV_INAS3$"Stand Reserve\r\n31.03.2024")
check_2.3 <- all.equal(FLV_sum3, sum(Schadenreserve_FLV_INAS3$Schadenreserve))
#CHECK 2.4
CHECK_Schadenreserve_FLV_LF1 <- read_excel(path_excel_flv, sheet = "SR aus UIP ab 2021")
FLV_sum4 <- sum(CHECK_Schadenreserve_FLV_LF1$Schadenreserve)
check_2.4 <- all.equal(FLV_sum4 , sum(Schadenreserve_FLV_LF1$Schadenreserve))
#CHECK 2.5
CHECK_Schadenreserve_FLV_LF2 <- read_excel(path_excel_flv, sheet = "SR aus UIP bis 2020")
FLV_sum5 <- sum(CHECK_Schadenreserve_FLV_LF2$Depot)
check_2.5 <- all.equal(FLV_sum5, sum(Schadenreserve_FLV_LF2$Schadenreserve))
#CHECK 2.6
sum_Schadenreserve_FLV <- FLV_sum1 + FLV_sum2 + FLV_sum3 + FLV_sum4 + FLV_sum5
check_2.6 <- all.equal(sum_Schadenreserve_FLV, sum(Schadenreserve_FLV$Schadenreserve))
CHECK 3
#CHECK 3.1
sum_Schadenreserve_Einzelvertrag <- sum_Schadenreserve_KLV + sum_Schadenreserve_FLV
check_3.1 <- all.equal(sum_Schadenreserve_Einzelvertrag, sum(Schadenreserve_Einzelvertrag$Schadenreserve))
#CHECK 3.2
check_3.2 <- all.equal(sum_Schadenreserve_Einzelvertrag, sum(Schadenreserve_Einzelvertrag_out$Schadenreserve))
#CHECK 3.3
check_3.3 <- all.equal(sum_Schadenreserve_Einzelvertrag, sum(Schadenreserve_Einzelvertrag_out2$RBNS_Reserve))
CHECK 4
#CHECK 4.1
sum_Auswertung_FC_clearing_account <- sum(Auswertung_FC_clearing_account_2024_Q1‘sum(tr))
#CHECK 4.2
check_4.2 <- all.equal(LIC_template_v1sumnoninother_part_of_IBNS))
#CHECK 4.3
sum_LIC_template_v1 <- sum(LIC_template_v1RBNSRBNS_Reserve))
#CHECK 4.4
sum1_LIC_template <- LIC_template‘Non−InvCpartother_part_of_IBNS %>% sum())
#CHECK 4.5
sum2_LIC_template <- LIC_template‘InvestmentComponent‘Investment_component %>% sum())
#CHECK 4.6
sum1_FC_adjustment <- CHECK1_FC_adjustmentadjustmentcheck4 %>% sum())
#CHECK 4.7
sum2_FC_adjustemnt <- CHECK2_FC_adjustmentInvcompnon_Inv_comp %>% sum()
check_4.7 <- all.equal(sum2_FC_adjustemnt, CHECK1_FC_adjustment$adjustment %>% sum())
#CHECK 4.8
check_4.8 <- all.equal(FC_adjustmentnonInvcomp,CHECnon_Inv_comp - CHECK2_FC_adjustment$Inv_comp)
#Check 4.9
check_4.9 <- all.equal(CHECK_LIC_template_v2‘InvestmentComponent‘,LICte)
#Check 4.10
check_4.10 <- all.equal(CHECK_LIC_template_v2‘Non−InvCpartofClaims‘,LIC)
checks and validations
check_1 <- all(check_1.1, check_1.2, check_1.3, check_1.4, check_1.5)
check_2 <- all(check_2.1, check_2.2, check_2.3, check_2.4, check_2.5, check_2.6)
check_3 <- all(check_3.1, check_3.2, check_3.3)
check_4 <- all(check_4.1, check_4.2, check_4.3, check_4.4, check_4.5, check_4.6, check_4.7, check_4.8, check_4.9, check_4.10)
CHECK_GIC_Asignment_LIC_values <- c(check_1, check_1.1, check_1.2, check_1.3, check_1.4, check_1.5,
check_2, check_2.1, check_2.2, check_2.3, check_2.4, check_2.5, check_2.6,
check_3, check_3.1, check_3.2, check_3.3,
check_4, check_4.1, check_4.2, check_4.3, check_4.4, check_4.5, check_4.6, check_4.7, check_4.8, check_4.9, check_4.10
)
CHECK_GIC_Asignment_LIC_names <- c("Check 1", "Check 1.1", "Check 1.2", "Check 1.3", "Check 1.4", "Check 1.5",
"Check 2", "Check 2.1", "Check 2.2", "Check 2.3", "Check 2.4", "Check 2.5", "Check 2.6",
"Check 3", "Check 3.1", "Check 3.2", "Check 3.3",
"Check 4", "Check 4.1", "Check 4.2", "Check 4.3", "Check 4.4", "Check 4.5", "Check 4.6", "Check 4.7", "Check 4.8", "Check 4.9", "Check 4.10"
)
CHECK_GIC_Asignment_LIC_descriptions <- c("These checks validate if the sum of ‘Schadenreserve’ in the document ‘Schadenreserve Zusammenfassung KLV’ does not change during the mutations.",
"Checks if the sum of ‘Schadenreserve’ in ‘Schadenreserve Einzelvertrag KLV LF1’ does not change during the mutation by comparing the sum from the original sheet with the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’ in ‘Schadenreserve Einzelvertrag KLV LF2’ does not change during the mutation by comparing the sum from the original sheet with the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’ in ‘Schadenreserve Einzelvertrag KLV RAI’ does not change during the mutation by summing up SR_vertr and SR_Gew from the original sheet and compare it with the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’ in ‘Schadenreserve Einzelvertrag KLV SUL’ does not change during the mutation by summing up SR_vertr and SR_Gew from the original sheet and compare it with the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’ in the whole document ‘Schadenreserve Zusammenfassung KLV’ did not change during the mutations and the binding by summing up all the sums from the original documents and comparing it with the sum after mutating and binding all the sheets from the document.",
"These checks validate if the sum of ‘Schadenreserve’ in the document ‘Schadenreserve Zusammenfassung FLV’ does not change during the mutations.",
"Checks if the sum of ‘Schadenreserve’, whereas it is named ‘Stand Reserve DATE’ with DATE being the date of the quarterly closure, in ‘Todesfaelle’ does not change during the mutation by comparing the sum from the original sheet to the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’, whereas it is named ‘Stand Reserve DATE’ with DATE being the date of the quarterly closure, in ‘L62ohne61’ does not change during the mutation by comparing the sum from the original sheet to the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’, whereas it is named ‘Stand Reserve DATE’ with DATE being the date of the quarterly closure, in ‘OP Liste does not change during the mutation by comparing the sum from the original sheet to the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’, whereas it is named ‘Depto’ in ‘SR aus UIP ab 2021’ does not change during the mutation by comparing the sum from the original sheet to the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’, whereas it is named ‘Depot’ in ‘SR aus UIP bis 2020’ does not change during the mutation by comparing the sum from the original sheet with the sum after the mutation.",
"Checks if the sum of ‘Schadenreserve’ in the whole document ‘Schadenreserve Zusammenfassung FLV’ did not change during the mutations and the binding by summing up all the sums from the original documents and comparing it with the sum after mutating and binding all the sheets from the document.",
"These checks validate if the sum of ‘Schadenreserven’ in the whole document ‘Schadenreserve Einzelvertrag’, which is the binding of ‘Schadenreserve Zusammenfassung KLV’ and ‘Schadenreserve Zusammenfassung FLV’ does not change during the mutations and creations of new data frames.",
"Checks if the sum of ‘Schadenreserve’ is exactly the sum of ‘Schadenreserve’ in ‘Schadenreserve Zusammenfassung KLV’ and ‘Schadenreserve Zusammenfassung FLV’ by summing up the previously created check-sums and comparing them with the sum after the binding.",
"Checks if the sum of ‘Schadenreserven’ does not change during the creation of ‘Schadenreserve_Einzelvertrag_out’ by comparint the sum before and after the mutations and bindings.",
"Checks if the sum of ‘Schadenreserven’ does not change during the creation of ‘Schadenreserve_Einzelvertrag_out2’ by comparint the sum before and after the mutations and bindings.",
"These checks validate that no needed data changes during the mutation of the fast close input by comparing the values that are worked with. Also there had to be checks incorporated in the block where new data frames are created, since a lot of date will be left out.",
"Checks if the sum of the values in ‘sum(transaction_amount)’ does not change during the creation of ‘test_fastclose’ from ‘Auswertung_FC_clearing_account_YEAR_Q’. where YEAR is the year that is worked with and Q being the quarter that is worked with.",
"Checks if all the values in ‘sum_non_inv’ from ‘LIC_template_v1’ are equal to the sum of ‘other_part_of_IBNS’ from ‘Schadenreserve_Einzelvertrag_out2’.",
"Checks if the sum of ‘RBNS_Reserve’ from ‘LIC_templete_v1’ and ‘Schadenreserve_Einzelvertrag_out2’ are equal.",
"Checks if the sum of ‘Non-InvC part of Claims’ from ‘LIC_template’ is equal to the sum of ‘other_part_of_IBNS’ from ‘LIC_template_v1’.",
"Checks if the sum uf ‘Investment Component’ from ‘LIC_template’ is equal to the sum of ‘Investment_component’ from ‘LIC_template_v1’.",
"Checks if the sum of ‘adjustemnt’ from ‘CHECK1_FC_adjustment’ is equal to the sum of ‘sum(transaction_amount)’ from’test_fastclose’.",
"Checks if the sum of ‘Inv_comp’ and ‘non_Inv_comp’ from ‘CHECK2_FC_adjustment’ is equal to the sum of ‘adjustment’ from ‘CHECK1_FC_adjustment’.",
"Checks if all the values in ‘non_Inv_comp’ from ‘FC_adjustment’ is equal to the difference of ‘non_Inv_comp’ and ‘Inv_comp’ from’CHECK2_FC_adjustment’.",
"Checks if all the values in ‘Investment Component’ from CHECK_LIC_template_v2’ and ‘LIC_template’ are equal.",
"Checks if the all the values in ‘Non-InvC part of claims’ from ‘CHECK_LIC_template_v2’ and ‘LIC_template’ are equal."
)
Val_GIC_Asignment_LIC_df <- data.frame(CHECK_GIC_Asignment_LIC_names, CHECK_GIC_Asignment_LIC_descriptions, CHECK_GIC_Asignment_LIC_values)
write.csv2(Val_GIC_Asignment_LIC_df,file="Validation of GIC_Asignment_LIC.csv",row.names = FALSE,sep=";",quote=FALSE)
In meinem ursprünglichen Excel möchte ich gerne Val_GIC_Asignment_LIC_df aufrufen und den Dataframe ausgeben lassen. wie geht das