Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem while exporting to EXCEL

Hello !

I have this tiny attached QVW file with only a SINGLE_FIELD.

When I view this SINGLE_FIELD inside QV itself, it works fine.

However, when I export this field to EXCEL, I have an error on the field value (it's altered).

Guess it's because I'm using the NUM#() function to load the field. The idea is to "force" the field to be loaded as numeric, ALWAYS.

Hope someone else can help me out with this problem !

Thanks !

1 Solution

Accepted Solutions
Not applicable
Author

Currently you are using

NUM#(SINGLE_FIELD) AS SINGLE_FIELD

Try using

NUM#(SINGLE_FIELD,'#') AS SINGLE_FIELD

Regards,

Nimish

View solution in original post

8 Replies
Not applicable
Author

Hi,

I have tried your sample application and tried to export it to Excel:

No error.
By the way, the num# cannot be the problem during export because you are using the num# in the load-scripts which is finished after loading 🙂

Maybe you should give it a new try or post here more details on your "error" ...

Best regards

Stefan

Not applicable
Author

Hi,

that a true error, not? The Value in QV is 7346076854.

I need the source file to test the thing. Thanks.

Have Fun with QV

Alex:)

Not applicable
Author

Yes the original value is not negative as it is shown in Excel !

Attached original file.

Not applicable
Author

Currently you are using

NUM#(SINGLE_FIELD) AS SINGLE_FIELD

Try using

NUM#(SINGLE_FIELD,'#') AS SINGLE_FIELD

Regards,

Nimish

Not applicable
Author

Thank you so much ! It works.

But I'd like to understand what's going on...

Not applicable
Author

The fact is that I load my data from CSV files and I'd like to detect invalid content during script load.

Say that I have a supposed numeric field on my CSV file. I dont trust that much that all of the records will contain a numeric content for this field.

So I have applied this syntax for this field load :

IF(SINGLE_FIELD = '','',IF(ISNUM(NUM#(SINGLE_FIELD,'#')),NUM#(SINGLE_FIELD,'#'),'INVALID NUMBER')) AS SINGLE_FIELD

Is that correct ? Is this the best syntax for this sort of error detection ?

I also do the same for Date fields , like this :

IF(SINGLE_FIELD = '','',IF(ISNUM(NUM#(SINGLE_FIELD)),NUM#(SINGLE_FIELD),'INVALID NUMBER')) AS SINGLE_FIELD

And for Time fields I apply this :

IF(TIME_FIELD = '','',IF(ISNUM(TIME#(TIME_FIELD,'hh:mm:ss')),TIME#(TIME_FIELD,'hh:mm:ss'),'INVALID TIME')) AS TIME_FIELD

The general idea is that the invalid content "bubles up" as a string on a List Box.

Thanks in advance for any help !

Not applicable
Author

You may want to use the alt function

alt(Num#(SINGLE_FIELD,'#'),'Invalid Number')

You can have multiple checks in this. The last parameter is used for if everything else fails. The same can be done for date formats.

Nimish

Not applicable
Author

Great ! Great ! Great !

Very aesthetic solution !

I knew about the ALT function but forgot to use it on this context !

Anyway, once more, thank you so much !