Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading number and text formats

Hi,

I have an issue when loading items into QV.

Some items load as text and some load as numbers. Some have '-' and some have letters in the string. View the image below.

My issue with the item numbers that load as numbers. Instead of loading as item # 15430, it loads as item # 15430.0000.

I have tried using TRIM but that doesn't work. I tried NUM but then it drops all of the item #'s formatted with a '-' or letter in them. I tried TEXT but that just aligns everything on the left.

I need to do this in the load script rather than on the object for example.

Any help would be great!

item num.PNG

1 Solution

Accepted Solutions
sunny_talwar

How about this:

If(IsNum(_ItemID), Num(_ItemID, '##'), _ItemID)

View solution in original post

11 Replies
sunny_talwar

How about bringing them all as text:

Text(_ItemID)

Not applicable
Author

purgchar(_ItemID,'0123456789')

Not applicable
Author

Text(_ItemID) just moves everything left

item as text.PNG

Not applicable
Author

I need to keep the ones formatted as 123-521 and 134G for example.

My issue is with the ones like 1543.000

sunny_talwar

How about this:

If(IsNum(_ItemID), Num(_ItemID, '##'), _ItemID)

Not applicable
Author

=num( KeepChar('153000','0123456789'),'#.##0')

Not applicable
Author

This worked. Thank you.

When I add my keys to it then it does not work unfortunately. Any idea?

p1.PNG

p2.PNG

sunny_talwar

Not sure if ItemID is already fixed, but may be this:

$(ConcatKey('$(varCompanyID)', If(IsNum(ItemID), Num(ItemID, '##'), ItemID))) as _ItemID

Not applicable
Author

There is an error message which I believe is because the amount of expressions in the variable

p3.PNG