Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have the following problem I cannot solve:
I want to create a Field with variable entries.
Eg: After some selections Field a has the possible Values X, Y and Z. Now I want Field B to contain exactly these three values.
| Field A |
|---|
| Z |
| Y |
| X |
| V (not possible Value) |
W (np) |
etc. (np) |
| Field B |
|---|
| Z |
| Y |
| X |
What I tried:
Create a variable: vCon = concat(Distinct [Field A],'/')
Script: Load subfield($(vCon),'/') as [Field B]
But I get an error message when loading the script:
Error in expression:
')' expected
If I try without a variable it works, so i belive the error lies there.
Load subfield('Z/Y/X','/') as [TestField B]
Hope someone can help, thank you in advance
Best regards
The variable vCon has to be calculated in the UI ... It is not obvious from your question where it is created ...?
1) In the UI as a create via some menu command?
2) As a line in the Load Script?
Thanks for your response!
It is created in the UI (settings>variable overview>add)
Two things that seem a bit odd:
1) Why is there no single quotation marks on each side of the $(vCon):
Load subfield($(vCon),'/') as [Field B]
The error message shows single quotation marks - how did they get into the error message.
2) Why are you using the two parameter version of SubField and not the three parameter version?
The two parameter version will generate one row for each of the values in the vCon - is that what you want?
The three parameter version picks out a specific subfield from the string.
Anyhow I think:
Load SubField( '$(vCon)' , '/' ) AS [Field B] .....
should be more correct with regards to the quotation marks.
You don't show the entire load statement either - could you do that - with the FROM or RESIDENT clause?
Yes, as I tried to show above I would like to generate one row for each of the values.
If do it as you suggest, I get as a result
Field B
= concat(Distinct [Field A],'
')
So the quotation marks somehow prevent the variable to be calculated.
If it is possible for you to share your application or a smaller sample of it to illustrate the problem as a QVW and upload it - it would be much easier to help you... ![]()