Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have an issue producing a dimension in a graph. the result comes up with ' - ' as the dimension instead of '50%' , '40%' or '30%'
Here is the dimension i have for the x axis of my graph.
=if($(vDiff%)
<=0.5,'50%',if($(vDiff%)<=0.4,'40%',
if($(vDiff%)<=0.3,'30%')
below is the variable in the expression. I have aggregated by 'Riskno' as this is necessary.
aggr
(if(Rank_1='ecar'or Rank_1='eCar' or Rank_1='asda OE' or Rank_1='Asda OE' or Rank_1='asda oe',
(if(Rank_2='ecar'or Rank_2='eCar'or Rank_2='asda OE' or Rank_2='Asda OE' or Rank_2='asda oe',
(Rank_1_Premium-Rank_3_Premium)/Rank_1_Premium,(Rank_1_Premium-Rank_2_Premium)/Rank_1_Premium)),
(-1*(Rank_1_Premium-Min({$<Insurer_Us={'Us'}>} [Premium]))/Rank_1_Premium)),
Riskno)
Can anybody see where my problem lies? I appreciate your help
Maybe the round function can help you ...?
=num(Round($(vDiff%),0.1),'0%')
I'm happy the Dimension expression is correct as it is a replica of one i have used in a different graph.
i believe the issue to be with the Variable.
Regards
Does it work, when you just put the variable as dimension? Could you post the definition for vDiff% ?
The variable definition vDiff% is included in the original question above.
aggr
(if(Rank_1='ecar'or Rank_1='eCar' or Rank_1='asda OE' or Rank_1='Asda OE' or Rank_1='asda oe',
(if(Rank_2='ecar'or Rank_2='eCar'or Rank_2='asda OE' or Rank_2='Asda OE' or Rank_2='asda oe',
(Rank_1_Premium-Rank_3_Premium)/Rank_1_Premium,(Rank_1_Premium-Rank_2_Premium)/Rank_1_Premium)),
(-1*(Rank_1_Premium-Min({$<Insurer_Us={'Us'}>} [Premium]))/Rank_1_Premium)),
Riskno)
I'm not quite sure, but I think you can't use aggr() without having any aggregation functions inside (sum, count, max etc). Maybe adding sum() after aggr() may help you.
Can you post an example qvw?
Hi
You did not close the brackets, or include an option for >50% in your dimension. I think you need:
=if($(vDiff%) <= 0.5, '50%',
if($(vDiff%) <= 0.4, '40%',
if($(vDiff%) <= 0.3, '30%', '>50%')))
Hope that helps
Jonathan
That in just an example. I did the bracket wrong in the example. My mistake.
The issue lies in the Variable i am sure of it. I just can't figure out the problem