4 Replies Latest reply on Apr 10, 2018 7:08 AM by Jim Dehner

    Control weeks data in tableau

    lingaiah yalagala

      Hi All,

       

      I have developed the tableau dashboard for 2018. I am having the data week wise from January 2018, every week will get excel file to load data in tableau,according to customer want to see latest 7 weeks data only in tableau.How do i restrict the data for latest 7 weeks in tableau. Please help me here. Thanks in advance.

       

      Regards,

      Yalagala

        • 1. Re: Control weeks data in tableau
          Jim Dehner

          Little confused - is it you intent that the data shown is limited to y weeks or the data table only include 7 weeks of data

           

          If you only want to show 7 weeks of data you can use

                    datetrunc('week',[ Date]) <= datetrunc('week',   dateadd('week',-7,today()))    as a filter - place on the filter shelf and set to context

           

           

          Jim

           

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          • 2. Re: Control weeks data in tableau
            Jim Dehner

            opps

            obviously meant datetrunc('week',[ Date]) >= datetrunc('week',   dateadd('week',-7,today()))

             

            Jim

            1 of 1 people found this helpful
            • 3. Re: Control weeks data in tableau
              lingaiah yalagala

              Hi Jim,

               

              Actual base table having data from January 2018, but customer want to see latest 7 weeks data only in tableau dashboard.

               

              Regards,

              Yalagala

              • 4. Re: Control weeks data in tableau
                Jim Dehner

                Then I would suggest you consider a wildcard union to bring in the new week of data on a weekly basis see the link  Union Your Data

                 

                And the context filter

                          datetrunc('week',[ Date]) >= datetrunc('week',   dateadd('week',-7,today()))

                 

                Jim

                 

                If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.