11 Replies Latest reply on May 1, 2018 2:16 PM by Jennifer VonHagel

    Hide all data if exceeds the # of x raws

    Vladimir Kostochka

      https://public.tableau.com/static/images/Te/TesthidedataifrowsmorethanX/Dashboard1/1.pngHi guys,

      I have a date variable with a filter where you can select period. There is a table with calculations by date. If you select big period, the table will be crowded.

      I'd like to create a magic ,if you select more than x rows, to get a message "please select different period".

      I have 2 variables in the table (date and name). Both of them can increase # of rows in the table.

      Do you have any ideas?

      Thank you,

        • 1. Re: Hide all data if exceeds the # of x raws
          Jennifer VonHagel

          Hi Vladimir,

           

          I think some magic can be done here - on a dashboard with floating/disappearing worksheets. Can you send a mockup of your data? I don't quite understand the date and name variables in your table, or your table layout in general.

           

          Best,

          Jennifer

          • 2. Re: Hide all data if exceeds the # of x raws
            Vladimir Kostochka

            Hi Jennifer,

            Thank for your help. The mockup of my data could be uploaded using Tableau Public?

            • 3. Re: Hide all data if exceeds the # of x raws
              Jennifer VonHagel

              Hi Vladimir,

               

              You can attach files to your messages on this forum. So you can attach the .twbx fie with extracted data to a message. Look for the link that says Advanced editor and add an attachment.

               

              Thanks,

              Jennifer

              • 4. Re: Hide all data if exceeds the # of x raws
                Vladimir Kostochka

                I uploaded the mockup.

                I have 2 variables Date Type ( change date view) and Survey ID (select a specific project)

                When I select all of them, it's not readable. But when I select only one survey ID, it looks Ok

                I would like to add a condition to show only if it's readable table. For example if max rows will be 30, show all data, else  show a message 'Select less period or a few surveys'

                Thanks,

                • 5. Re: Hide all data if exceeds the # of x raws
                  venkat.ram.1

                  Can you share.twbx file, Unfortunate, Public Links has been block at office space.

                  • 6. Re: Hide all data if exceeds the # of x raws
                    Vladimir Kostochka

                    I have attached the test.twbx

                    • 7. Re: Hide all data if exceeds the # of x raws
                      Jennifer VonHagel

                      Hi Vladimir,

                       

                      Attached is a workbook mocked up a little like your data. I created a filter section at the top. It has a horizontal container with your filters and parameter. Underneath it shows a little visual of the number of records produced by the filters as they are currently set. You can see that the records here are 2037, and so the message appears.

                       

                      See how the objects are laid out. The Table and the Text box message are both floating objects. The Text box message is placed behind the Table. The Table sheet has a filter specifiying that number of records must be <= 30. When this is not true, all the data on the Table worksheet disappears. The Table object is still there, but it is transparent. So when its data disappears, the text box behind that is sitting behind it shows up.

                       

                      You do not have to show that chart in the filter section - you can remove it and this worksheet will still work. I just thought it might guide users into how to pare down the records to the 30 limit max.

                       

                       

                      And if 30 records or fewer, then the table appears:

                       

                       

                      I have attached the workbook for you. I have to run out at the moment, but I can write up the details of how I created this a bit later today. Hopefully the workbook will be clear .

                       

                      Also, it is here on Tableau Public: Tableau Public

                       

                      Best,

                      Jennifer

                      • 8. Re: Hide all data if exceeds the # of x raws
                        Jennifer VonHagel

                        Hi Vladimir,

                         

                        I will show instructions with text.twbx that you attached. I have Tableau 10.5, you won't be able to open the workbook, so I will show with screenshots.

                         

                        The idea is that we'll create a filter to check the number of records in your table. If they are > 30 (or whatever number you choose), this will filter out all data in the entire table - leaving the worksheet blank.

                         

                        In the dashboard, we'll create a text box with the message that there are too many records. We'll put the Table floating on top of it. Both the text box and table will always be present, but when the table is showing data - this will hide the text box. When the table is not showing any data, the message box behind the table will show up.

                         

                        Create this calculation to count the records in your table. Although the calculation box is saying it calculates along Table (across), once it is in the view it is set to Compute Using > Table Down.

                        Record Count: SIZE()

                         

                        Put Record Count on the filter card as a continuous field (not discrete, when it is continuous it will be green, when discrete it is blue), and choose the max number you wish to show:

                        Let's try it out: I select one survey, and it has only 9 records, it shows.

                         

                        I clear the survey filter, and there are too many records, everything except the worksheet's Title is blank:

                         

                        I'll put this in the dashboard:

                        The Table needs to be a floating object, so it can sit on top of the text box:

                        Drag a floating text box onto the dashboard, and type in whatever message you like.

                        Position the text box over the header of your table:

                        Then in the text box menu, go to Floating Order > Send backward.

                        Now it is hidden behind the table header. By the way, we can remove the Record Count field from the table - it doesn't need to be there.

                         

                        But if I clear the filter to allow all values, then the data disappears and the text box sitting behind it is visible.

                        I hope this helps!

                        Jennifer

                        • 9. Re: Hide all data if exceeds the # of x raws
                          Jennifer VonHagel

                          If you want to create the Filter Box with chart I showed in my original example, let me know and I can write out the steps.

                           

                          Thanks,

                          Jennifer

                          • 10. Re: Hide all data if exceeds the # of x raws
                            Vladimir Kostochka

                            Thank you so much. Exactly want I wanted.