Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

SJ_16
New Contributor

% - Stop them adding together

Hi,

I have the following logic below with the 'Country' Filter.

When I select the country for AUS and SA the percentages work as expected, however when I look at the consolidated view, the percentages sum up rather than working out the exchange rate within the 'vFX_Sel'

Any idea how to resolve this please?


Sum({<[SFL Name]= {"New Rate"},

Year={$(=YEAR(TODAY()))}>} [Top Value]/$(vFX_Sel))

5 Replies
afroz_shaik
New Contributor III

Re: % - Stop them adding together

Hey steve,

Can you provide some sample data?

SJ_16
New Contributor

Re: % - Stop them adding together

I only have limited data as a one month snap shot I am reviewing but essentially if I have for AUS 75% and SA 65% my consolidated view is 125%. Probably doesn't help you I'm afraid.

This is the logic in the  FX Variable:    IF([Country]='AUS',Closing_AUS_FX_RATE,1)

afroz_shaik
New Contributor III

Re: % - Stop them adding together

Can you try this expression

Sum({<[SFL Name]= {"New Rate"},

Year={$(=YEAR(TODAY()))}>} [Top Value])/($(vFX_Sel))

SJ_16
New Contributor

Re: % - Stop them adding together

Thanks, but that still gives me the same results. I have tried so many variations but I just can't get it to work.

vamsee99999
Valued Contributor

Re: % - Stop them adding together

Hi Steve,

I would suggest you create a new column with the exchange rate on the backend instead of using a variable.

Like

[Top Value] *   IF([Country]='AUS',Closing_AUS_FX_RATE,1) as Fx_Top_Value.


Coming to your expression

Try

For variable $(vFX_Sel) =IF(GetFieldSelections([Country])='AU',Closing_AUS_FX_RATE,1)


Sum({<[SFL Name]= {'New Rate'}, Year={"$(=YEAR(TODAY()))"}>} [Top Value] / $(vFX_Sel))