Reputation: 13
I have the following table. Input:
Prd_no Prd_Name Fiscal_month sales
123 XXX 012015 10000
123 XXX 022015 999
124 yyy 022015 20000
125 ZZZ 122015 30000
From this table, I will give the user fiscal_month prompt. Based on the month user selected, sales should be displayed for the selected month and previous month sales. For Example, if he has chosen 022015 then sales for 022015 and then sales for 012015 should be displayed.
Output:
Fiscal month
012015 021015
Sales 10000 999
I have used parameters and calculated fields but nothing is working.
Kindly help me on this.
Upvotes: 1
Views: 297
Reputation: 1099
Step 1 : Create Parameter Fiscal_Parameter
and Populate it with Month Data.Keep Type of Parameter as Integer .
Step 2 : Create Calc Field Previous Month
IF INT( [Fiscal_parameter]/10000 ) = 1 THEN
INT('12'+ STR(INT([Fiscal_parameter]%10000)-1)
)
ELSE INT(
STR(INT(([Fiscal_parameter]/10000-1)))+
STR(INT([Fiscal_parameter]%10000)
)
)
END
STEP 3 : Create Calc Field PREV MONTH SALES
IF [Fiscal month] = [Previous Month] THEN [Sales] END
STEP 4: Create Calc Filed CURRENT MONTH SALES
IF [Fiscal_parameter] = [Fiscal month] THEN [Sales] END
Step 5 : In your Sheet Use Prod Name
, CURRENT MONTH SALES
and PREV MONTH SALES
. Show Parameter Control also .
Let me know if that works out for you.
Upvotes: 1