Skip to main content

logoCorrectSize.png

Adaptive Insights LLC.

Switch Statement to Pull Data from a Specific Month in Another Account to Populate all Months

In the following example, I used a Switch Statement to pull July data from Account B into all months in the same year into Account A.  In fiscal year 2019, $5,000 was pulled from July of 2019 into all months in 2019.  In fiscal year 2020, $6,000 was pulled from July of 2020 into all months in 2020.

clipboard_e76650eb3f5a285ac1831c6592367d81d.png

Below is the formula:

switch(this.year.positionof(this.month),1,ACCT.6330_Maintenance[time=this+6],2,ACCT.AccountB[time=this+5],3,ACCT.AccountB[time=this+4],4,ACCT.AccountB[time=this+3],5,ACCT.AccountB[time=this+2],6,ACCT.AccountB[time=this+1],7,ACCT.AccountB,8,ACCT.AccountB[time=this-1],9,ACCT.AccountB[time=this-2],10,ACCT.AccountB[time=this-3],11,ACCT.AccountB[time=this-4],12,ACCT.AccountB[time=this-5],0)


  • Was this article helpful?