Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I reformat fields in script?

I'm working on my first report, which uses the same fields in several sheet items.  The source data is an Excel sheet, and, although, I highlighted and formatted each column, many of the numerical fields are showing more digits after the decimal point than I'd like. 

Example: data formatted as $1.2274 in data table is displayed as 1.2273189243510 in Qlikview.

I can reformat the fields within each sheet item's Properties, but I'd like to do it more efficiently (before loading the data).  I've found instructions for reformatting dates but not for numbers or, possibly, text - is this possible?

Thanks in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

try like this:

Load

          Num(PreField, '##.####') as NewField

View solution in original post

4 Replies
tresesco
MVP
MVP

You can try num() function. It allows formatting as well.

Not applicable
Author

I tried this, but it didn't work.

[Prev Field Name],

[Field Name] as num(#,0000),

[Post Field Name],

I googled a bit more and found num() used in an expression, but I can't do that in the script, can I?

tresesco
MVP
MVP

try like this:

Load

          Num(PreField, '##.####') as NewField

Not applicable
Author

Thank you so much!

Too bad it doesn't apply to existing instances - but I'll redo my work and know for next time.

Edit.  It is working in my straight table and list boxes, but not in my pivot tables.