Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

qv_testing
Valued Contributor

Dynamic Format in Bar chart

Hi Community,

I have developed one chart based variable selection it will change the SalesAmount and Sales%.

Expression 1:

Sum(Sales)

Expression 2:

Num(Sum(Sales)/Sum(Total Sales), '##,#0.00%')

Note: Num format not working, like showing 0.63. I have to convert into 63%


these expression's changing based on toggle button. (Amount and Percentage)


In Qlikview NUM format works fine, but qlik sense not working.


I have read this document... https://community.qlik.com/thread/161478

but not working..


Please anyone can help me....


Thanks in Advance....



11 Replies
omarbensalem
Esteemed Contributor

Re: Dynamic Format in Bar chart

Try as follow please:

Num(Sum(Sales)/Sum(Total Sales), '# ##0,00%')

satishkurra
Valued Contributor II

Re: Dynamic Format in Bar chart

ALso this

Num(Sum(Sales)/Sum(Total Sales), '#,##0%')


Also make sure you specify the format on right pane to Auto


If doesn't work try custom format and specify the format as

#,##0%;(#,##0%)

qv_testing
Valued Contributor

Re: Dynamic Format in Bar chart

Single expression wise working fine...

My expression like

IF(vNumber=1, Sum(sales),  Num(Sum(Sales)/Sum(Total Sales), '##,#0.00%'))


I have one list box like NUMBER and PERCENTAGE

if i make selection NUMBER, i want to show Sales Amount,

same as PERCENTAGE, want to show Sales Percentage.


Dimension: Category

Expression: IF(vNumber=1, Sum(sales),  Num(Sum(Sales)/Sum(Total Sales), '##,#0.00%'))


Hope you understand......!!

qv_testing
Valued Contributor

Re: Dynamic Format in Bar chart

Custom Format it won't work, because i have IF, ELSE condition in expression

omarbensalem
Esteemed Contributor

Re: Dynamic Format in Bar chart

can u please share a 'test' application?

qv_testing
Valued Contributor

Re: Dynamic Format in Bar chart

PFA,

Please have a look below image, I want to show like 22%, 50%, 28%.....

Capture.PNG

omarbensalem
Esteemed Contributor

Re: Dynamic Format in Bar chart

what's the version u're using?

It works fine for me (and I havn't done anything to ur app):

Capture.PNG

Capture.PNG

saniyask
Contributor

Re: Dynamic Format in Bar chart

Hi,

please refer to the attached application

Regards,

Saniya

saniyask
Contributor

Re: Dynamic Format in Bar chart

You can try this in the expression If(Selection='Number', Sum(sales), Sum(sales)/Sum(Total sales)) and in the number format choose Custom format --> Format pattern --> ##,#0.00% or ##,#0%

Regards,

Saniya