6 Replies Latest reply on Mar 13, 2017 1:04 PM by PJ S

    Filters on views

    PJ S

      Hi all,

       

      I have data like this

      Source1 - Cat, SubCat, Sales, CatGoals, Date

      (we don't have any goals for SubCat)

       

      when I try to make a viz- Date vs Sales and Goals (dual axis- Sales- Bar and Goals-Line)

      color by SubCat on Sales Bar

      Filters - Cat, SubCat

       

      when I filter SubCat, tableau automatically calculates goals for SubCats, is there a way to avoid this and just have CatGoals on my viz while filtered by SubCat.

       

      any help is appreciated

        • 1. Re: Filters on views
          Karthik Venkatachalam

          If you don't have Goals for SubCat, how can it automatically calculate Goals for SubCats?

           

          Suggest, make a copy of CatGoals and call it "CatGoals_calc".  Add a FIXED LOD at Category level.  {Fixed Category: sum()}

          Drag this field in, and you should see it at Cat level. Not Subcat level.

          1 of 1 people found this helpful
          • 2. Re: Filters on views
            PJ S

            Thanks Karthik, that works but I see a new issue

             

            My dashboard is filtered by Cities (Using a parameter for cities, since we need selected cities),

            If I see a system/overview of cities, the above calculation works but when I select 1 city, Goals remain for system/overview

             

            My calc looks like this { FIXED  [Date] : SUM([Goal])}

            I have used Fixed Date since the viz is Date vs Sales and Goals

             

            Overview

            Overview.PNG

            City Using LOD Calc

            Used Calc-City-SEA.PNG

             

            Actual value

            Actual Values for SEA.PNG

            • 3. Re: Filters on views
              PJ S

              sorry replied to original question. (getting used to forums)

              • 4. Re: Filters on views
                Karthik Venkatachalam

                Hi PJ,

                Could you please attach the workbook?

                • 5. Re: Filters on views
                  PJ S

                  Hey Karthik,

                   

                  Unfortunately I can't attach workbook, since it is secured data. I could achieve the LOD expression in 5/6 sheets.

                  One of my vizs is : weekday vs Sales and Goals (Sales -Bar and Goals-Line) dual axis, colored by sub-cat

                   

                  My vision of the chart is

                  when a user filters sub cat, sales bar should change but goals should remain at cat level.

                  I could achieve this using LOD expressions for months vs Sales and Goals, YTD vs Sales and Goals, Exact Date vs Sales and Goals but I am unable to achieve it for Week Day vs Sales and Goals.

                   

                  The Calculation I used for Exact Date vs Sales and Goals looks like this.

                  { FIXED  [Day-Date], [City], [Year Date],[Month Date] : SUM([Goal])}

                  • 6. Re: Filters on views
                    PJ S

                    I ve been trying to use this expression for week day

                    {FIXED [WeekDay], [City], [Month Date], [Year Date]: SUM([Goal])}

                     

                    WeekDay --> DATEPART('weekday', [Flight Origin Date])

                    Month Date --> DATEPART('month', [Flight Origin Date])

                    Year Date --> DATEPART('year', [Flight Origin Date])