Multiple calculations in an insight is obscuring formatting

I currently have an insight that contains two calculations (to For loops). Each calculation checks a condition and displays a message if the condition is true. However, If the second calculation returns true than the message will display but spaced down (correlating with where that second message is written in the calculation). Likewise, when the first calculation returns true, the message appears at the top (The place it should appear). (I have included an image of this). This is obscuring the formatting. It seems as if there is a placeholder for each calculation and the message appears according to that placeholder. Is there any way I can rework the calculations to have them appear at the top of the insights box or at least in the same place each time?
These are my calculations:

This is what happens when calculation 2 returns true:
This is what happens when calculation 1 returns true:

Hello @huda.h.yazgi, I have 2 ideas to try and fix this display, so hopefully one of them meets your use case. My first thought is rather than building this out as 2 different BLOCK FOR aggregations, what if you built the 2 different FOR loops into a single BLOCK IF function that would run a different FOR loop depending on your filter values. I think that would resolve the issue of it accounting for each loop as a portion of the visual.

The alternative would be to have 2 different insights on a sheet set to Free Form layout where each insight would run one of the 2 functions. Then you could use the Rules under the Interactions tab of the Edit Visual panel to set each visual to appear based on that parameter value rather than including it in the function. I’ll include a screenshot below of where you find the option for Rules.


Let me know if either of those options work for you or if you run into any issues when implementing them, I am happy to help. Thank you!

Thank you for your response @DylanM
What I did is first added a block IF and indicated the condition. Then I added an inline FOR Loop (B/C I cant add a block for in a block IF) and indicated the for loop content. Then added an Inline IF with an INLINE FOR. But this is my result in the second image (which is not what I am looking for and hitting enter to move the loop contents on a new row does not work). First image is the calculation.


Also, when I tested the second part of my INLINE IF, it did not work.

I have done the 2 different insights prior and overlayed them as you indicated in your comment above, and it worked, but that will increase my number of visuals in the dashboard to a little above 50.

Hello @huda.h.yazgi, is there an issue with having more than 50 total visuals? As long as you don’t have over 30 visuals on a single sheet, your dashboard should still publish without an issue. I don’t think there would be an alternate work-around to display this in a single insight without wrapping both statements inside of a single block function. Which I definitely understand that there are limitations to that as well.

@DylanM it will be a little over 50 visuals in a single sheet if I were to do workaround option 2. I am not sure if I can have over 50 in one sheet- I know the max is 30 before performance is affected. And the insight dos not allow me to put to block for loops in a block IF. Additionally, when I use 2 INLINE for loops in a single block IF, calculation is incorrect.

Hello @huda.h.yazgi, based on all of the information and testing we have done, I do believe the only way to achieve your desired output will be to use the Rules to display one visual or the other based on that parameter value. Also, in regards to the QuickSight documentation, you shouldn’t have more than 30 visuals on a single sheet, not 50. In that case, I think it would be best if you split up your visuals across 2 or even 3 sheets in a dashboard to ensure it functions correctly.

1 Like