Hi all.
I am struggling with something that should be reallly easy 😞
I have this table:
fieldA | fieldB | algorithm |
1 | 3 | fieldA*fieldB |
2 | 4 | fieldB |
2 | 8 | fieldB/fieldA |
and just want to obtain a result field such as:
fieldA | fieldB | algorithm | result |
1 | 3 | fieldA*fieldB | 3 |
2 | 4 | fieldB | 4 |
2 | 8 | fieldB/fieldA | 4 |
How do I "catch" fieldA and field B to get result?
I need to "make it" within the script.
Thanks in advance!
Kind regards.
hi, here this a possible solution
dados:
LOAD
Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B')) AS CAL,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='*',fieldA * fieldB,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='/',fieldB / fieldA,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='',fieldB
)
)
) as Result,
* Inline [
fieldA, fieldB, algorithm
1, 3, fieldA * fieldB
2, 4, fieldB
2, 8, fieldB / fieldA
];
hi, here this a possible solution
dados:
LOAD
Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B')) AS CAL,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='*',fieldA * fieldB,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='/',fieldB / fieldA,
if(Trim(PurgeChar(algorithm,'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B'))='',fieldB
)
)
) as Result,
* Inline [
fieldA, fieldB, algorithm
1, 3, fieldA * fieldB
2, 4, fieldB
2, 8, fieldB / fieldA
];