Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

Here I am having a table with input data

Prd_no Prd_Name Fiscal_month sales
123     XXX      012015     10000
123     XXX      022015     999
124     yyy      022015     20000
125     ZZZ      122015     30000

And I have produce output 

           Fiscal month
           012015   021015 

Sales 10000 999 

I have updated parameters and calculated feilds and noting is working to display selected and previous month sales 

1 Answer

0 votes
by (22.5k points)
edited by

Step 1 : Assign Fiscal_Parameter and mix up with Month Data.The datatype of parameters should be a integer .

Step 2 : Create a calculated feild as Previous Year

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 : And the create a calculated feild called Previous Month Sales

IF [Fiscal month] = [Previous Month] THEN [Sales] END

STEP 4: Current month sales calculated feild

IF [Fiscal_parameter] = [Fiscal month] THEN [Sales] END

Get trained to use Tableau with full potential through Tableau Online Training.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...