Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max Block Size in Block Chart

Hi,

I have a block Chart and I have the second expression shown as "Text as Pop-up".

For that expression, I need the size of the bigger block in this chart.

The expression for the size of the block is this:

if(ID_Medida = '1', Sum({<Giro1 = {'1'}>}[Estoque Un])/1000,

if(ID_Medida = '2', Sum({<Giro1 = {'1'}>}[Estoque Kg])/1000,

if(ID_Medida = '3', Sum({<Giro1 = {'1'}>}[Custo Total Contábil])/1000)))

I've tried to use

RangeMax(

if(ID_Medida = '1', Sum({<Giro1 = {'1'}>}[Estoque Un])/1000,

if(ID_Medida = '2', Sum({<Giro1 = {'1'}>}[Estoque Kg])/1000,

if(ID_Medida = '3', Sum({<Giro1 = {'1'}>}[Custo Total Contábil])/1000)))

)

in the second expression, but that have not returned the size of the bigger block, it returned only the size of the block itself.

How can I obtain the max value, so I can use it in all the blocks, for the second expression ?

Thanks !!

2 Replies
johnw
Champion III
Champion III

So you want the size of the largest block in your whole chart?  The expression will depend on your dimensions.  For the sake of argument, let's say you have one dimension, "Customer".  The maximum block size is then:

max(aggr(
if(ID_Medida = '1', Sum({<Giro1 = {'1'}>}[Estoque Un])/1000,
if(ID_Medida = '2', Sum({<Giro1 = {'1'}>}[Estoque Kg])/1000,
if(ID_Medida = '3', Sum({<Giro1 = {'1'}>}[Custo Total Contábil])/1000)))
,Customer)

Though you might need to repeat the set analysis expression.  I can't remember:

max({<Giro1 = {'1'}>} aggr(
if(ID_Medida = '1', Sum({<Giro1 = {'1'}>}[Estoque Un])/1000,
if(ID_Medida = '2', Sum({<Giro1 = {'1'}>}[Estoque Kg])/1000,
if(ID_Medida = '3', Sum({<Giro1 = {'1'}>}[Custo Total Contábil])/1000)))
,Customer)

Not applicable
Author

Hi John, it works, but in another graph I have some other problem with that.

With the expression:

=if(ID_Medida = '1', Max(Aggr(Sum(if(AnoMes > ValorPeriodoLimite, [Estoque Un])), AnoMes))/1000,

if(ID_Medida = '2', Max(Aggr(Sum(if(AnoMes > ValorPeriodoLimite, [Estoque Kg])), AnoMes))/1000,

if(ID_Medida = '3', Max(Aggr(Sum(if(AnoMes > ValorPeriodoLimite,[Custo Total Contábil])), AnoMes))/1000)))

I get the Max Value, but with :

=if(ID_Medida = '1', Min(Aggr(Sum(if(AnoMes > ValorPeriodoLimite, [Estoque Un])), AnoMes))/1000,

if(ID_Medida = '2', Min(Aggr(Sum(if(AnoMes > ValorPeriodoLimite, [Estoque Kg])), AnoMes))/1000,

if(ID_Medida = '3', Min(Aggr(Sum(if(AnoMes > ValorPeriodoLimite,[Custo Total Contábil])), AnoMes))/1000)))

I aways get zero as minimum (I know that the true minimum is not zero).

ValorPeriodoLimite is an variable.

Can you help me how to solve this ?

Thanks !!!