Nested Sum of Values

Hi guys,

I am having a problem with the sum of specific values in drill down functionality. So basicaly I want to be able when I drill down to see the value 1 for beta and value 2 for gama in the bars. And when I drill up YI would like to be able to only have the sum of original values and not the sum of all the values from the data set. In the Alpha there should be the value 3 (sum of the original authentic values from the level below.


Thanks in advance.

Hello!! Hope this message finds you well!!

If I understand well, my suggestion is do something like:
Firstly, create a calculated field to ensure only the desired values are summed. For instance, if you want to assign the value 1 to “beta” and 2 to “gama”, you can use a formula such as:

ifelse( {Category} = 'beta', 1, {Category} = 'gama', 2, 0 )

This formula assigns 1 to “beta”, 2 to “gama”, and 0 to all other categories, ensuring that only the relevant values are considered during the drill-down process.

Next, configure the drill-down functionality to utilise this calculated field. This ensures that the bars in your visualisation display the correct values when you drill down into the data.

To manage the aggregation when drilling up, you can use parameters to define the logic for summing values based on the drill level. For example, you might set up a parameter to differentiate between drill-down and drill-up levels, and use a formula like:

ifelse( ${drillLevel} = 'up', sum({OriginalValues}), sum({CalculatedValues}) )

Here, ${drillLevel} is a parameter that identifies the current drill level. When drilling up, the formula sums the original values, while drilling down sums the calculated values.

Finally, ensure that your visualisations are properly configured to reflect these calculations and parameters. This will allow you to display the correct values at each drill level, whether you are drilling down to see specific values or drilling up to view the sum of original values.

Well, I think that following these steps, you can effectively control the summation of values in qs drill-down and drill-up functionality, ensuring your data visualisations are both accurate and meaningful.

Hello lary_andr,

thank you for your answer. If I am understanding it right, the problem with the solution is that I am using it on a big data set that is being automatically generated. To map every possible combination of a name and value wit the “ifelse” statement would not be the best way to go in this case. In best case there should be an option to take just one value from the given authentic name (“beta”, “gama”) and use it as a basis for the sum while drilling up. I would not be sure how to code this calculated field though.. :confused:


My suggestion is create something with drill-down and drill-up functionality, using calculated fields and parameters dynamically. For drill-down, create a calculated field to assign specific values to categories:

ifelse({Category} = 'beta', 1, {Category} = 'gama', 2, {OriginalValue})

For drill-up, use a parameter to control aggregation logic:

ifelse(${drillLevel} = 'up', sum({OriginalValue}), sum({CalculatedField}))

Here, ${drillLevel} is a parameter indicating the current drill level. Configure your visualisations to use these calculations, ensuring the correct values are displayed at each level. This avoids manual mapping and works efficiently with large datasets.

Hi lary_andr,

I am not sure if it is possible to set the formulas in parameters or set the other value calculating/generating rules for different drill down levels (supreme and below). If you can make an succesfull example using the same data set I would be really greateful. :slight_smile:

Supreme Below Value
Alpha Beta 1
Alpha Beta 1
Alpha Gama 2
Alpha Gama 2
Alpha Gama 2

Hello @Quick Sight.User-123

The challenge her is that you want the value field to change aggregations from max (grouping by value for Below) to sum (still grouping by Below). In a visual, even with drill downs, you can only set the field well aggregation once.

Along what @lary_andr mentioned, you will need a system to change out the value field well aggregation. My recommendation would be to break these visuals apart. If you want the user to still have the experience of having one visual you could use free form layout and use conditional rules to hide and show visuals based on a click from a parameter action.

I’m going to mark this as a solution for now but if you need more help feel free to still leave a comment below.