Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Over the past year I have found your site to be EXCELLENT. Never have I been able to find so many answers to such vast problems and it is an excellent service..."

Geography

Where in the world do Tek-Tips members come from?
kavithapedada (Programmer)
7 May 12 4:32
Shared NumberVar  m1 ;
Shared NumberVar m2;
Shared NumberVar m3;
Shared NumberVar m4;
Shared NumberVar m5;
Shared NumberVar m6;
Shared NumberVar m7;
Shared NumberVar m8;
Shared NumberVar m9;
Shared NumberVar m10;
Shared NumberVar m11;
Shared NumberVar m12;
if {@mONTH} = 1 then
m1= {@mONTH} ;
if {@mONTH} = 2  then
m2 = {@mONTH};
if {@mONTH} = 3 then
m3 = {@mONTH} ;
if {@mONTH} = 4 then
m4= {@mONTH} -1;
if {@mONTH} = 5 then
m5 = {@mONTH} -2;
if {@mONTH} = 6 then
m6 = {@mONTH} -3;
if {@mONTH} = 7 then
m7= {@mONTH} - m6 - m3;
if {@mONTH} = 8 then
m8 = {@mONTH} - m6 - m3;
if {@mONTH} = 9 then
m9 = {@mONTH} - m6- m3;
if {@mONTH} = 10 then
m10= {@mONTH} - m9 - m6 -m3;
if {@mONTH} = 11 then
m11 = {@mONTH}- m9 - m6 - m3;
if {@mONTH} = 12 then
m12 = {@mONTH} - m9 - m6 - m3;
 
  if  {@mONTH} = m1 +  m2 + m3 and {@Year} = {?YEAR}
   then  "This year Q1 "
   if  {@mONTH} = m1 +  m2 + m3 and {@Year} = {?YEAR} -1
  then  "Last year Q1 "
   Variance = Q1 This Year - Last year
  then  "This year Q1 "
  if  {@mONTH} = m4 +  m5 + m6 and {@Year} = {?YEAR}
  then  "This year Q2 "
etc.............................


Here {@MONTH} = Formula to get the month from Date
     
i want to display in the Cross Tab like " Q1 - This Year" and Q1 - Last Year" and Variance etc...

Iam unable to to use the above logic some where id i did mistake please help me to clear it

 
lbass (TechnicalUser)
7 May 12 6:42
You need to use := instead of : to set the variables, like this:

if {@mONTH} = 1 then
m1 := {@mONTH};

-LB
kavithapedada (Programmer)
8 May 12 0:10
if {@mONTH} = 1 then
m1 := {@mONTH};

if i use this syntax its giving the below error

""A PRINT TIME FORMULA THAT MODIFIES VARIABLES IS USED IN A CHART OR MAP""
lbass (TechnicalUser)
8 May 12 6:44
You didn't mention that you were trying to chart with these formulas. The error message is because you are using variables. If you must chart these, then you have to use a complex technique "Charting on Print-time Formulas" as shown here:
http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/40e7130d-aa1e-2b10-ce9f-eee2a54ff4cd?QuickLink=index&;overridelayout=true

Why are you using shared variables in the first place? What is the purpose of the adjustments you are making to values?

-LB
kavithapedada (Programmer)
8 May 12 23:04
Hi

I want to calu the Last year and this year Q1 values with conditions like

in Paramters if they enter: Period = 10
then the Its Q4 , so the values need to come like 10 - 9 -6-3( Need to subtract the previous Quartes values) for the present Qurater value

Regards,
Kavitha.
lbass (TechnicalUser)
9 May 12 6:38
Please show the content of {@Month}. In looking at your formula, it doesn't make sense. You are just saying if a month = 1 then you are setting it equal to 1, etc.

Also, you seem to want to subtract other values, so is your value field cumulative? Please show some sample data and label it.

You did not explain why you are using shared variables.

-LB

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close