Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got dozens of raw files I load each day (see attachment). I've got a script (attached) that processes these in to QVD format. I've got a field in the raw data called Capacity that shows the figure as a percentage (i.e. 25%). I want to trim the '%' sign from this field whenever it occurs. I don't simply want to trim the last character in case it's not a %, so the script must specifically trim '%' signs only from this field. What's the best way to achieve this?
Try the PurgeChar() function.
Try the PurgeChar() function.
The easiest way is, when you load you file (es. gbl05928_filesystem.Sep_04_2014) to do:
Load
...
PurgeChar(Capacity, '%') as capacity
from
...
Let me know
Hi Shane,
I would simpy do an "replace(Capacity, '%', '') AS Capacity". Maybe this helps already
Kind regards
Peter
That's perfect - assumed there would be an easy answer, it's just about knowing what that answer is.
PurgeChar(Capacity, '%') as Capacity%
Yup - It's all there in the QV Desktop Help, but as always the Catch 22 is that it is only easy to find as long as you already know the answer.
Thank you Peter Hübschen the "replace" function came in very handy for updating the last 7 months worth of processed data in 1 easy swoop! i.e.
LOAD Date,
Server,
Hour,
Minute,
Main_metric,
replace(sub_Metric, 'Capacity', 'Capacity%') AS sub_Metric ,
replace(value, '%', '') AS value