Hat jemand eine Spaltenformel oder ein Skript geschrieben, mit dem ich ein Datum: eine Uhrzeit in eine bestimmte Woche oder ein bestimmtes Quartal im OBSCURE-Finanzkalender meines Unternehmens umwandeln kann, der als "5-4-4"-Finanzkalender bekannt ist? Ich sehe Google-Referenzen auf andere Finanzkalender, aber anscheinend ist das 5-4-4 ungewöhnlich.
Soweit ich dieses System verstehe, könnten Sie einfach die Anzahl der Tage ab Beginn eines bestimmten Jahres ermitteln und dann die Woche und das Quartal basierend auf der Anzahl der Tage und der Länge jedes Quartals berechnen.Möglicherweise müssen Sie 53 Wochenjahre berücksichtigen, aber dies sollte Ihnen den Einstieg erleichtern:
New Table( "Fiscal Week",
Add Rows( 1000 ),
New Column( "Date", Numeric, "Continuous", Format( "yyyy-mm-ddThh:mm:ss", 19, 0 ),
Input Format( "yyyy-mm-ddThh:mm:ss", 0 ),
Formula( Date DMY( 4, 1, 2021 ) + Row() * In Hours( 12 ) )
),
New Column( "Fiscal Year", Numeric, "Continuous", Format( "Best", 12 ),
Formula(
Floor( (:Date - Date DMY( 4, 1, 2021 )) / In Days( 52 * 7 ) ) + 2021
)
),
New Column( "Fiscal Day of Year", Numeric, "Continuous", Format( "Best", 12 ),
Formula(
Floor( Mod( (:Date - Date DMY( 4, 1, 2021 )) / In Days( 1 ), 52 * 7 ) )
+ 1
),
Set Display Width( 67 )
),
New Column( "Fiscal Week of Year", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Floor( (:Fiscal Day of Year - 1) / 7 ) + 1 ),
Set Display Width( 85 )
),
New Column( "Fiscal Quarter", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Floor( (:Fiscal Week of Year - 1) / 13 ) + 1 ),
Set Display Width( 65 )
)
);