Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

scotly-victor
Contributor

% in expression

Hi Everyone,

I have set up  toggle for refund value and refund percentage for KPI Object .

If I select refund value the  KPI should show value and

If I select refund percentage the KPI should show % .


I have set up number formatting as auto .

I had used num(,'##.##%'

).

It doesn't work

Any help please?


Tags (1)
7 Replies
MVP
MVP

Re: % in expression

May be try like this:

If(showvalie, Num(Sum({<Flag = P{Refund}>} Sales), '#,##0.00', Num(Sum({<Flag = P{Refund}>} Sales)/Sum/(Sales), '#,##0.00%')

I made up the expression, replace the above with your actual expressions

scotly-victor
Contributor

Re: % in expression

This is my expression

It did not work

if(%Perval='value',

num(((SUM({<type={'order'},$(vPeriod)>} [selling fees])+

SUM({<type={'order'},$(vPeriod)>}[fba fees] )+

SUM({<type={'order'},$(vPeriod)>} [other transaction fees] )

+ SUM({<type={'order'},$(vPeriod)>}other))*-1)/100000,'#0.00')

,

num((((SUM({<type={'order'},$(vPeriod)>} [selling fees])+SUM({<type={'order'},$(vPeriod)>}[fba fees] )+SUM({<type={'order'},$(vPeriod)>} [other transaction fees] )

+ SUM({<type={'order'},$(vPeriod)>}other))*-1)/sum({<type={'order'},$(vPeriod)>}[Net Sales])),'#0.00%')

)

Re: % in expression

What do you meant by Refund Percentage here?

Percentage of the amount refunded to the concern Org/Person from the Bill/Invoice amount?

if so you could have to try

Num(Refund Value/Invoice Amount,'##.##%')

% in number format, will just multiply the value with 100 and adds '%' symbol at the end

MVP
MVP

Re: % in expression

May be because of missing parenthesis at the very end?

If(%Perval = 'value',

Num(

(

(Sum({<type={'order'},$(vPeriod)>} [selling fees]) +

Sum({<type={'order'},$(vPeriod)>} [fba fees])+

Sum({<type={'order'},$(vPeriod)>} [other transaction fees])+

Sum({<type={'order'},$(vPeriod)>} other))*-1)/100000,'#0.00')

,

Num((((SUM({<type={'order'},$(vPeriod)>} [selling fees])+SUM({<type={'order'},$(vPeriod)>}[fba fees] )+SUM({<type={'order'},$(vPeriod)>} [other transaction fees] )

+ SUM({<type={'order'},$(vPeriod)>}other))*-1)/sum({<type={'order'},$(vPeriod)>}[Net Sales])),'#0.00%'))

)

scotly-victor
Contributor

Re: % in expression

Sorry,

Commission percentage

Re: % in expression

not worked - Are you getting null value?

Are you getting value for refund expression?

Check the value returned by below expression is correct

sum({<type={'order'},$(vPeriod)>}[Net Sales])

scotly-victor
Contributor

Re: % in expression

Sorry sunny,

still same