Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, it is possible to use variable (let x = SubStringCount(produkty,';') as SubStringCount) to existing table?
Just wanted not use manually Subfield fields( Prod1.Apt, Prod2.Apt etc.)
SubStringCount(produkty,';') as SubStringCount = 14, but only 8 Subfields have values.
You may use something like:
set v1 = "subfield([product.Apt], ';', $1)";
to apply something like:
load *, $(v1(1)) as [Prod1.Apt], $(v1(2)) as [Prod2.Apt], ...
or even try:
set v2 = "subfield([product.Apt], ';', $1) as [Prod$1.Apt]";
for:
load *, $(v1(1)), $(v1(2)), ...
But I suggest to rethink this approach because you creates with it a crosstable which has often much more disadvantages as benefits. IMO better would be to load these data with an internal load-loop like:
load*, subfield([product.Apt], ';') as MyField from X;
or maybe with:
load*, subfield([product.Apt], ';', iterno()) as MyField, iterno() as IterNo
from X while iterno() <= substringcount([product.Apt], ';');