# Calculate in Dynamic cross Tab

Hi,

Im looking for a solution to realise a % calculation between X columns in a dynamic cross tab

…Years 2006 | Years 2007
Line Number | Amount | Amount

My problem is to realise a dynamic formula which give the evolution % between the amounts

To know: The start and the End years are defined by prompt!

Thanks for help

lionel (BOB member since 2007-04-30)

try this,

``Flag1 = If FormatDate(ToDate(<Year Object>,"YYYY"),"YYYY")=UserResponse("Data Provider Name", "Start Year") Then 1 Else If FormatDate(ToDate(<Year Object>,"YYYY"),"YYYY")=UserResponse("Data Provider Name", "End Year") Then 2``
``% = Sum(If <Flag>=1 The <Amount>)/Sum(If <Flag>=2 The <Amount>)``

KhoushikTTT (BOB member since 2005-02-24)

Thanls for your answer, anyway i’m affraid that’s it’s does’nt work in the case of a Dynamic cross Table…

lionel (BOB member since 2007-04-30)

Hey,

This particular solution doesn’t work for header/footer calculations because you’re out of context. I believe that’s what you’re trying to do.

However, the one highlighted in the FAQ does work like a charm and is generally easier to implement
https://bobj-board.org/t/15226/18

hope that helps[/code]

Willyzekid (BOB member since 2007-05-03)