Select part of other variable

Is it possible to use “Left” in combination with a separation marker like comma?

I get a lot of tables resulting from multiplechoice boxen where there are a few numbers separated by a comma. I’m looking for a way to split these (preferably in Webi).

Example;

1,4,7
1,12,18
3,14,5

These are not easy to split with a “left” command because they vary in length…

Hi,

The formulas can be ugly and long in WebI. If possible, do the parsing of the values in the database or in the universe.

1 Like

you are very right about the long formulas (18 pages in this case…)
What do you mean by parsing values in the database or universe?

You can create complex objects directly in the universe, using SQL expression. It is generally much more efficient than big variables inside webi documents. And you don’t have to redefine variables for each document as it is available directly as universe object :wink:

2 Likes

ok, and how would you do this?

Hi,

What is the backend database? Oracle or something else?
If it’s oracle, then use Substr function in conjunction with Instr to split the string and create columns such as Value 1, Value 2, Value 3, and so on.
Value 1 = substr(table.column , 1 , instr(table.column , ‘,’ , 1)-1)
Value 2 = substr(table.column, instr(table.column , ‘,’ , 1)+1, instr(table.column , ‘,’ , 2)-1)
Value 2 = substr(table.column, instr(table.column , ‘,’ , 2)+1, instr(table.column , ‘,’ , 3)-1)

Thanks,
Mohammed

1 Like