Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I would like you to help me with a script. I need to create a column by replacing the textual content from another existing column, for example:
Coke 2L ---> 2L
Sugar 1KG ---> 1KG
Flour 5KG ---> 5KG
....
Can you guide me how to implement this? I believe I have to replace the letters until I get the goal, but I don't know how to start. Thanks.
You could try to use subfield() for this.
Subfield ([YourStringField], ' ', -1)
ok, but sometimes the field content can be complex or open, and I still want to extract the unit correctly.
I think of creating a routine that can read a part of the content and transform it into what I want, for example:
Coke (2 L) or Coke (2 L)iters ---> 2L
Sugar (5 KG) or Sugar (5 K)ilos ---> 5KG
thanks
Hello Guys,
I am trying to use the replace function, but I realized that Qlikview can implement it just 100 times (ie. Replace(Replace( text, 'A', 'a'), 'B', 'b')....., 'ZZZ', 'zzz'). I need to use more than 200 replaces, can somebody tell me a way to do it?Thanks
Take a look at the MapSubstring() function. It might be a good fit for your scenario.