To explain my issue I need to give some simplified background data. I'm using the following fields from a Universe table:
Year, Account#, AccountType, AmountPeriod1, AmountPeriod2, AmountPeriod3...AmountPeriod12, UserPromptCurrentPeriod
Using this source data I have created two queries in Web Intelligence. The only difference between them is one of the filters. qryActuals filters on AccountType=Actual and qryBudgets filters on AccountType=Budget.
To keep this short, I have the following two report columns:
Colum Actual = variableActual where variableActual = If([UserPromptCurrentPeriod]=1) Then [qryActuals].[AmountPeriod1] ElseIf([UserPromptCurrentPeriod]=2) Then [qryActuals].[AmountPeriod2]...ElseIf([UserPromptCurrentPeriod]=12 Then [qryActuals].[AmountPeriod12]
Colum Budget uses the same idea except the variable is called variableBudget and is defined as pulling the AmountPeriod value from the qryBudgets query.
The Actuals column works perfectly. Every account # has the correct amount based on the period selected by the user. However, the Budgets column shows the same value for each account, which is correct only for the first account. Why is one column working but not the other? Could it be because I'm pulling the Account # for the report from the qryActuals?