Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create a generate a loop in the expression/text box on the based of selection in a table.
On the basis of selection I got the string in the table which is separated by comma (,) and I want to run the loop to find out how many strings I have after using
=SubStringCount(Priority_Combination, ',' )
and I want to store this in a variable so that I can run a loop.
and further want to store each value of string in a variable.
thanks
Please explain with example
ValueLoop() function can help you with looping. Furthermore you could do a Concat() to join values from a field into a string or a string with multiple lines using a carriage return as a value separator - Chr(10).
Maybe SubField() also can be of help to split a string into multiple values into conjuction with ValueLoop().
If you give a more specific use case / example it would be easier to suggest the right approach.
Hi sumit.arora
Can you give an example with the sample data. So that it will help the folks to give quick and efficient solution.
Hi All,
See attached image below:
As you see highlighted column Priority_Combination it has a string separated with comma (,) now I want to get each value of this string into variables, so I can identify which rules parameter are there in that particular rule.
New_Cat_Rule is the list box for the list of rules names and all have different combination.
Many thanks
Sumit
May be this can be helpful.
Script:
Table:
LOAD * Inline [
RuleID | Priority_Combination
29 | VENDOR_NUMBER, PURCHASING_ORDER, MATERIAL_GROUP
] (delimiter is |);
Create a Variable vVar: SubField(Priority_Combination, ',', '$1')
And then in the text box object, try this as your expression:
=$(vVar(1)) to get VENDOR_NUMBER
=$(vVar(2)) to get PURCHASING_ORDER
=$(vVar(3)) to get MATERIAL_GROUP
Attaching the qvw for your reference.
HTH
Best,
Sunny
Sunny,
Thanks for the quick response, but the Priority_Combination is not constant.
There are 40 set of rules on the basis of 9 parameters (Vendor, Contract, GL, text, category etc) and they changes on the basis of selection from the list box (New_Cat_Rule).
Sumit
Not entirely sure what you mean? Can you show an example???
Issue is that data is too big behind so attach the file.
See below image now you can see 4 set of rows for the Priority_Combination and 4 different rules in the New_Cat_Rule list box.
Thanks
In the above example what would be saved in a variable??? If we know that, we might be able to figure it out what can be done