Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
MEDHA07
Contributor III
Contributor III

Rate calculation total is not giving the results and showing null symbol in total

Hi All,

I have 4 measure calculations

i need to divided by column(3) expression divide by column(2) to calculate.

need to display the values based on range.range values in script i stored in variable and using in table.

set vRangeTest = '<= $5M',
'> $5M and <= $10M',
'> $10M and <= $15M',
'> $15M and <= $20M';

i need to get column(3) total value divide by column(2) total value in Rate total

locationpremimun/TIv

HarishM07_1-1674152024326.png

 

i dont want sum for Rate totals

Expected resulst:0.0158699

HarishM07_0-1674151706629.png

 

Labels (1)
1 Reply
jcmachado
Contributor III
Contributor III

To perform the calculation of column(3) divided by column(2) and display the results based on a range, you can use a combination of the if() and aggr() functions.

Here's an example of how you can do this:

=if(aggr(sum(column(3))/sum(column(2)), Location) $(vRangeTest)  as 'Rate total'

This will divide the total value of column(3) by the total value of column(2) for each value of Location, and then display the result based on the range specified in the variable vRangeTest.

Note that, the result will be summed across all the location, if you do not want the sum of Rate totals, you can use the above expression in the table level and not in the total level. Also, you might need to adjust the script to match your specific requirements. Please let me know if you have any other question.