Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Highlighted
komminenianusha
New Contributor III

Number format issue

Hi All,

How to show field values in % format.I have one field which contains values like 20%,45%,2,4,55% etc.. when i select number format as % in qliksense it shows like 20%,45%,200%,400%,55% but its wrong i want to display like 20%,45%,2%,4%,55% etc.. 

Please help me for getting this. 

Thanks in advance.

 

Regards,

Anusha

1 Solution

Accepted Solutions
mark_costa
Contributor

Re: Number format issue

Hi Anusha,

You can use the code below as reference for your problem:

[TempOriginalValues]:
Load * Inline [
OriginalValue
20%
45%
2
4
55%
];

[Treatedvalues]:
Load
    [OriginalValue],
    Num(PurgeChar([OriginalValue],'%')/100,'#,##0%') AS [TreatedValue]
Resident
    [TempOriginalValues]
;

DROP TABLE [TempOriginalValues];

 

This will generate this result:

treatedvalues.png

3 Replies
agni_gold
Valued Contributor II

Re: Number format issue

Divide these numbers by 100 first and then select % as number format.
pradosh_thakur
Honored Contributor II

Re: Number format issue

purgechar(fieldname,'%')  

This is delete all the percentage fromthe number .

You can use

purgechar(fieldname,'%')  /100

and use number format as %

Learning never stops.
mark_costa
Contributor

Re: Number format issue

Hi Anusha,

You can use the code below as reference for your problem:

[TempOriginalValues]:
Load * Inline [
OriginalValue
20%
45%
2
4
55%
];

[Treatedvalues]:
Load
    [OriginalValue],
    Num(PurgeChar([OriginalValue],'%')/100,'#,##0%') AS [TreatedValue]
Resident
    [TempOriginalValues]
;

DROP TABLE [TempOriginalValues];

 

This will generate this result:

treatedvalues.png