Announcements
cancel
Showing results for
Did you mean:
Master

two sum in one cell

Hi All,

A:

[

PID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,300,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

b:

[

ID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,150,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

i have data like above.  here i want to show the result in stright table

Year      (sum({TableA}Value)/sum({TableB}Value)

for example      result for one row

year                      Sum

2018                    (650/500)           ------------------ here i want to show result two tables sum  as   (result1/result2)        within braket by sepertor /

1 Solution

Accepted Solutions

MyTable:

Load *, 'A' as SourceTable Inline

[

PID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,300,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

CONCATENATE (MyTable)

Load *, 'B' as SourceTable Inline

[

ID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,150,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

Straight table:

Dimension: Year

Expression: ='(' &sum({<SourceTable={'A'}>}Value) & '/' & Sum({<SourceTable={'B'}>}Value) & ')'

talk is cheap, supply exceeds demand
3 Replies

MyTable:

Load *, 'A' as SourceTable Inline

[

PID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,300,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

CONCATENATE (MyTable)

Load *, 'B' as SourceTable Inline

[

ID,Year,Value,volume,Product

1,2018,100,300,A

2,2018,250,1,B

3,2018,150,2,C

4,2017,555,3,D

5,2017,5193,4,E

6,2017,6661,5,F

7,2017,100,6,G

];

Straight table:

Dimension: Year

Expression: ='(' &sum({<SourceTable={'A'}>}Value) & '/' & Sum({<SourceTable={'B'}>}Value) & ')'

talk is cheap, supply exceeds demand
Master
Author

thank you it worked

but one question-  like  use want to select   Product from   table b      how can  we identify  the value from  table b ?

for example  i add list box  product    i have  different values in table a and different values in table b..

Add a listbox for the SourceTable field. Then select the required source table in that listbox.

talk is cheap, supply exceeds demand
Community Browser