I have 2 columns in my report.
First column has this formula : ( revenue earned in 1998 for a region(s) ) =<Total Sales Revenue - YTD> Where (=“1998”)
2nd column has :
=<Total Sales Revenue - YTD> Where (=“1999”)
is a variable that was created to have : =FormatNumber(Year(),"####")
I want to remove the hard-coded values ‘1998’ and ‘1999’ and use a variable instead.
OR
Is there any other way I can rewrite the expression “=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using that hard-coded year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
In a message dated 00-01-19 12:00:33 EST, you write:
Is there any other way I can rewrite the expression
“=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using that hard-coded year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
Create variables as follows:
Variable: First Year
Formula: = UserResponse(,“Enter First Year”)
Variable: Second Year
Formula: = UserResponse(,“Enter Second Year”)
Variable: First Year Flag
Formula: =If = Then 1 Else 0
Variable: Second Year Flag
Formula: =If = Then 1 Else 0
Variable: First Year Sales
Formula: =Sum() Where ( = 1)
Variable: Second Year Sales
Formula: =Sum() Where ( = 1)
I am assuming you might want to prompt for the two years. If not, adjust accordingly.
By moving the check for “1998” (first year) or “1999” (second year) into another variable, you can test a constant value of 1 or 0 in the Sum()… Where() clause.
Refresh your report and fill ‘1999’ in the MessageBox, then display in your 2 columns ‘Revenue from Query 1’ (ie 1998 revenue) and ‘Revenue from Query 2’ (ie 1999 revenue).
In a message dated 00-01-19 12:00:33 EST, you write:
Is there any other way I can rewrite the expression
“=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using
that hard-coded
year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
Create variables as follows:
Variable: First Year
Formula: = UserResponse(,“Enter First Year”)
Variable: Second Year
Formula: = UserResponse(,“Enter Second Year”)
Variable: First Year Flag
Formula: =If = Then 1 Else 0
Variable: Second Year Flag
Formula: =If = Then 1 Else 0
Variable: First Year Sales
Formula: =Sum() Where ( = 1)
Variable: Second Year Sales
Formula: =Sum() Where ( = 1)
I am assuming you might want to prompt for the two years. If not, adjust
accordingly.
By moving the check for “1998” (first year) or “1999” (second year) into
another variable, you can test a constant value of 1 or 0 in the Sum()…
Where() clause.
You can have two data providers, first one pulling data for 1998 and next one pulling 1999 data. then link them on common dimensions.
hope it helps. let me know if u need further …
vasan
Would appreciate any ideas on this.
BO 4.1.5.
I have 2 columns in my report.
First column has this formula : ( revenue earned in 1998 for a region(s) ) =<Total Sales Revenue - YTD> Where (=“1998”)
2nd column has :
=<Total Sales Revenue - YTD> Where (=“1999”)
is a variable that was created to have : =FormatNumber(Year(),“####”)
I want to remove the hard-coded values ‘1998’ and ‘1999’ and use a variable instead.
OR
Is there any other way I can rewrite the expression “=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using that hard-coded year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
Thankyou Vasan.
Mr. Dave Rathbun’s solution exactly fits the bill ( as appended at the end ).
Regards,
Unni
Unni,
You can have two data providers, first one pulling data for 1998 and next one pulling 1999 data. then link them on common dimensions.
hope it helps. let me know if u need further …
vasan
Would appreciate any ideas on this.
BO 4.1.5.
I have 2 columns in my report.
First column has this formula : ( revenue earned in 1998
for a region(s) )
=<Total Sales Revenue - YTD> Where (=“1998”)
2nd column has :
=<Total Sales Revenue - YTD> Where (=“1999”)
is a variable that was created to have : =FormatNumber(Year(),“####”)
I want to remove the hard-coded values ‘1998’ and ‘1999’ and use a variable instead.
OR
Is there any other way I can rewrite the expression “=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using that
hard-coded
year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
Thanks & Regards,
Unni
In a message dated 00-01-19 12:00:33 EST, you write:
Is there any other way I can rewrite the expression
“=<Total Sales Revenue - YTD> Where (=“1998”)” and achieve the same results ( ofcourse without using
that hard-coded
year ) ?
BO syntax does not accept a variable in its WHERE clause after the “equal to”.
Create variables as follows:
Variable: First Year
Formula: = UserResponse(,“Enter First Year”)
Variable: Second Year
Formula: = UserResponse(,“Enter Second Year”)
Variable: First Year Flag
Formula: =If = Then 1 Else 0
Variable: Second Year Flag
Formula: =If = Then 1 Else 0
Variable: First Year Sales
Formula: =Sum() Where ( = 1)
Variable: Second Year Sales
Formula: =Sum() Where ( = 1)
I am assuming you might want to prompt for the two years. If not, adjust
accordingly.
By moving the check for “1998” (first year) or “1999” (second year) into
another variable, you can test a constant value of 1 or 0 in the Sum()…
Where() clause.