ExcelAtEverything
Active Member
- Joined
- Jan 30, 2021
- Messages
- 351
- Office Version
- 2019
- Platform
- Windows
Hello, I'm having trouble changing the BOLD portion of the following GETPIVOTDATA formula, to be dynamic. I've edited the Date & the Year parts already, but I keep getting a syntax error when I attempt change on the "Org #" part. The "Org #" part shown here is still from the original static code.
=GETPIVOTDATA("[Measures].[Sum of Total Discount]",'LY Discounts Yearly'!$B$3,
"[LY Orders Data Tab - Discounts].[Org #]","[LY Orders Data Tab - Discounts].[Org #].&[237]",
"[LY Orders Data Tab - Discounts].[Date]","[LY Orders Data Tab - Discounts].[Date].&["&TEXT($G$3-366,"yyyy-mm-dd") & "T00:00:00]",
"[LY Orders Data Tab - Discounts].[Date (Year)]","[LY Orders Data Tab - Discounts].[Date (Year)].&"&"["&YEAR($G$3-366)&"]")
My attempt which gave the syntax error was:
"[LY Orders Data Tab - Discounts].[Org #]","[LY Orders Data Tab - Discounts].[Org #].&[" &[@[Org '#]]& "]",
Thanks!
=GETPIVOTDATA("[Measures].[Sum of Total Discount]",'LY Discounts Yearly'!$B$3,
"[LY Orders Data Tab - Discounts].[Org #]","[LY Orders Data Tab - Discounts].[Org #].&[237]",
"[LY Orders Data Tab - Discounts].[Date]","[LY Orders Data Tab - Discounts].[Date].&["&TEXT($G$3-366,"yyyy-mm-dd") & "T00:00:00]",
"[LY Orders Data Tab - Discounts].[Date (Year)]","[LY Orders Data Tab - Discounts].[Date (Year)].&"&"["&YEAR($G$3-366)&"]")
My attempt which gave the syntax error was:
"[LY Orders Data Tab - Discounts].[Org #]","[LY Orders Data Tab - Discounts].[Org #].&[" &[@[Org '#]]& "]",
Thanks!