13 Replies Latest reply on Aug 13, 2018 2:07 PM by Rosario Gauna

# Need a Dynamic calc for Getting a small Multiples Grid.

Dear Tableau Folks/Viz Gurus / Zen masters

I am struggling for a Calculation which Generates the Dynamic Grid for small Multiples but the center of the Grid should be empty.

For creating a small Grid. I am using the below calc. Now I need to adjust my calc in such a way which should make the middle value null in Tableau

ROW VALUE

if (INDEX()/[Column Selection])= Int(INDEX()/[Column Selection])

THEN (INDEX()/[Column Selection])

ELSEIF  (INDEX()/[Column Selection])<0 THEN Int(INDEX()/[Column Selection])

ELSE Int(INDEX()/[Column Selection]+1) END

COLUMN VALUE

IIF(INDEX()% [Column Selection]=0,[Column Selection],INDEX()% [Column Selection])

Simon Runc

• ###### 1. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Hmmm, interesting challenge. What exactly defines the center? Will it always be 9 grid spaces or does it need to be dynamic as well? If so, what are the rules that should be applied to determine its size?

• ###### 2. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Thanks, ken Sir for your Quick Response.

This is what my thought Process for one of my Dashboard design.

First, it should Dynamically define the grid space based on the number of marks ( Dimension  available on Detail shelf.)

Most of the times we are using the size function.

Column Divider

(index()-1)%(round(sqrt(size())))

Row Divider

int( (index()-1)/(round(sqrt(size()))))

What I want, If the user clicks on any states ( Say A, B, C...) all the KPI's(which is another Sheet) Wrt to that state should show in the blank /Null Area.

• ###### 3. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Hmmm! Not sure on this one. Definitely very tricky

When I have these kind of ideas (in the "anything goes" initial stages of thinking)...I often then look at the implementation and think if the "juice is worth the squeeze" (as they say!) and then end up with something that hits the "spirit" of the idea, just a bit more pragmatically. For example here, it might be that having a collapsing floating container in the center, which appears when a state is selected would give a similar effect, but far more simply.

If I were going to attempt this (and in fact I do most times I use a small-multiple/trellis layout) I'd pre-compute the Rows and Columns in the SQL (or data view creation, if you are using something else to generate the data view). This has the advantage of letting us then "Bin" the Rows/Columns (with a bin size 1), and thus use the "Show Missing Values" (or the "Show Empty Columns/rows) which helps the densification (as the Rows/Columns are real dimensions). It also means I don't need to mess on with the Table Calculations when State A has 10 marks and State B has 12 (which messes up the default way index() works). I can also do more complicated/bespoke/iteration-based stuff in the Python/SQL to get the layout just as I want.

Hope that helps, but I'll have a think over the next few day and let you know if anything comes to mind

• ###### 4. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Hi All,

I took a stab at this and I kind of have something that works but I'm not sure what (or even possible) to define as middle when the grid is an odd number. Also, if there is a better way to calculate the 9 x 9 section I'm up for learning something new (you'll see its very inelegant).  I'm not even sure you can even use this but hey maybe it'll inspire someone! See attached version 10.5.

Regards,

Gerardo

• ###### 5. Re: Need a Dynamic calc for Getting a small Multiples Grid.

I just noticed that It also breaks for anything less 8 columns and rows. This definitely needs some more work!

Regards,

Gerardo

• ###### 6. Re: Need a Dynamic calc for Getting a small Multiples Grid.

This is very close to what I am looking for

Is it happening because the extreme point is 8 in your ID?

There is something very similar to what I am looking for but it's not dynamic. Could you please have a look

• ###### 7. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Hi Rajeev,

Simon was right on the money!  Susan has coordinates defined at the data source and is just floating a sheet over those points.  Any how, I was wrong in what I stated earlier. I've made an adjustment to the attached. It isn't a fully there yet, but hopefully that's a bit closer!

Regards,

Gerardo

Ninja Edit:  Attached the correct workbook.

1 of 1 people found this helpful
• ###### 8. Re: Need a Dynamic calc for Getting a small Multiples Grid.

I am just playing with your workbook and it seems like its working.

I will try to plug it into my original data and will let you know the output.

Just a Quick question - If I want to compute based on my dimension say States, will this create a grid keeping the middle section null.?

• ###### 9. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Rajeev,

You use to be a pretty active in this community so you know I can't answer that question without a packaged workbook.

Regards,

Gerardo

• ###### 10. Re: Need a Dynamic calc for Getting a small Multiples Grid.

First of all I am really sorry for not attaching a workbook .

Actually,I am travelling this entire week  and I am not having access to Tableau so I thought, I should ask question now,get my understanding clear  and check the  above listed methods later part of the day

Sorry for causing you enough trouble

• ###### 11. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Rajeev! I share what I did, I hope I have understood what you are looking for. And that these formulas help you or at least be a starting point to achieve it.

1 of 1 people found this helpful
• ###### 12. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Senorita Guana,

Su calculacion para la cuadricula es mucho mas elegante que la mia. Es realmente un trabajo fantastico!

(Your calculation for the grid is much more elegant than mine.  Fantastic work!)

Saludos,

Gerardo

• ###### 13. Re: Need a Dynamic calc for Getting a small Multiples Grid.

Eres muy amable, Gerardo! Gracias!