Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a string made in this way:
"14|13|5"
I would like to convert this string by using a condition....
for example: If one of the value is > 10 then transorm it in A else in B:
I would like to have as a result:
"A|A|B"
Is it possible ?
Thanks in advance
If number of | is fixed (2) then you can use expression:
If(Subfield(Field,'|',1)>10,A,B) &'|'&If(Subfield(Field,'|',2)>10,A,B)&'|&'If(Subfield(Field,'|',3)>10,A,B)
Regards
Vijay
Is this string have fixed number of "|" ??
Hi,
Assuming the following script:
LOAD Concat(ValueCheck, '|') AS ValueCheck2;
LOAD If(SubField(Value, '|') > 10, 'A', 'B') AS ValueCheck INLINE [
Value
15|14|3
];
The field ValueCheck2 will store as you want. SubField() will return each part separated by "|", the If() will return "A" or "B", the Concat() in the preceding load will concatenate values "A" and "B" using "|" as separator and store them into a new field called ValueCheck2.
Hope that helps.
Miguel
This has to be done as en expression of a graph... I cannot use that in a load instruction
Indeed this the expression made for generating the string:
=concat(distinct round(AGGR(SUM(W_FT_VALORE_NETTO),C_PROVINCIA_FATT)), '|',fieldIndex('C_PROVINCIA_FATT', C_PROVINCIA_FATT))
If number of | is fixed (2) then you can use expression:
If(Subfield(Field,'|',1)>10,A,B) &'|'&If(Subfield(Field,'|',2)>10,A,B)&'|&'If(Subfield(Field,'|',3)>10,A,B)
Regards
Vijay
I am sorry but I don't know the exact number .... I am very unlucky ... I know is a very complicated problem
What do you think, Macro is the only way to cope with this problem ?
Hi,
Did you try to use the same expression, but using the conditional instead?
=concat(distinct If(round(AGGR(SUM(W_FT_VALORE_NETTO),C_PROVINCIA_FATT)) > 10, 'A', 'B'), '|',fieldIndex('C_PROVINCIA_FATT', C_PROVINCIA_FATT))
Hope that helps.
Miguel
Yes that was my first try .... but the concat function makes all difficult:
If I add a if .... it's going to show me a string made up of a number equal to my C_PROVINCIA .... and not just the aggregation made up with the sum. I cannot get why... really. The main problem is the concat function.