Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
is Rangesum possible on single field with concatenated values?
Rangesum(Trimlist)
I tried belwo and it worked 😀Thanks Anyway for taking the time to respond.
T1:
LOAD * inline [
ID|Value
1|3
2|4
3|6
4|7
5|8
6|1
7|11
8|2
9|78
10|13
] (delimiter is '|');
T2:
NoConcatenate
Load *,
Rangesum(Peek(Sum),Value) AS Sum,
exp(Rangesum(log(Peek(Product)),Log(Value))) AS Product
RESIDENT T1
ORDER BY ID ASC;
DROP TABLE T1;
Exit script;
The following worked with a manual string in a textbox - maybe you could adapt it to your field:
=rangesum($(=replace('1.1,2.2', chr(39), '')))
- Marcus
Thanks, Could not get it, Below is the sample script that replicates my scenario? Coul d you please give it a try?
Even if it can be done on script level should work for me. Thanks again
T1:
LOAD * inline [
ID|Value
1|3
2|4
3|6
4|7
5|8
6|1
7|11
8|2
9|78
10|13
] (delimiter is '|');
T2:
Load *,
Left(Right(List,Len(List)-1),Len(List)-2) as TrimList;
LOAD*,
if(1, Peek('List')&','&Value,Value) AS List
RESIDENT T1
ORDER BY ID ASC;
DROP TABLE T1;
Exit Script;
T1:
LOAD * inline [
ID|Value
1|3
2|4
3|6
4|7
5|8
6|1
7|11
8|2
9|78
10|13
] (delimiter is '|');
T2:
Load *,
//Left(Right(List,Len(List)-1),Len(List)-2) as TrimList;
Mid(List,2) as TrimList;
LOAD*,
if(1, Peek('List')&','&Value,Value) AS List
RESIDENT T1
ORDER BY ID ASC;
DROP TABLE T1;
Exit Script;
My suggestion couldn't be applied within a chart on a dimensional level because the used $-sign expansion creates an adhoc-variable which is calculated globally before the chart is calculated and this result is taken for each row.
Of course a script-solution would be much better. This could be done with subfield(), for example with something like this:
load ID, subfield(TrimList, '|') as TrimListPart from Source;
- Marcus
I tried belwo and it worked 😀Thanks Anyway for taking the time to respond.
T1:
LOAD * inline [
ID|Value
1|3
2|4
3|6
4|7
5|8
6|1
7|11
8|2
9|78
10|13
] (delimiter is '|');
T2:
NoConcatenate
Load *,
Rangesum(Peek(Sum),Value) AS Sum,
exp(Rangesum(log(Peek(Product)),Log(Value))) AS Product
RESIDENT T1
ORDER BY ID ASC;
DROP TABLE T1;
Exit script;