Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis and Concat

Hi, I have 2 tables like this:

table1:
LOAD * INLINE [
account, Amount
a, 1200
b, 500
c, 100
];

table2:
LOAD * INLINE [
Group, Accounts
g1, "a"
g2, "a,b,c"
g3, "b"
];

i use set analysis and concat, to group:

sum( {$< account = { $(=Concat(Accounts,',')) }>} Amount)

but the result is the total (1800)

[:S]

Thanks all for the help,

ja

5 Replies
Not applicable
Author

Hi,

is there a reason why your table could not look like this:

table2:
LOAD * INLINE [
Group, account
g1, a
g2, a
g2, b
g2, c
g3, b
];

Rainer

Not applicable
Author

Hi Rainer,

There is not a real reason, is only a test structure for understand:

sum( {$< account = { $(=Concat(Accounts,',')) }>} Amount)

Thanks,

ja

Not applicable
Author

with the current structure of table2, this expression wont work..as in one Accounts, you have several of the variables 'account'.

if you change the structure of the table to what Rainer suggests, that should work..



vidyut
Partner - Creator II
Partner - Creator II

I looked at it, and find that the following expression in the table gives the desired result:

=Sum(If(Concat(total account,',')=Accounts,Amount,0))

Check if you are mixing your account and Accounts in the expression.

Not applicable
Author

Rainer, Navee, Vidyut

if i changed the structure, work fine,now.

thanks a lot...

ja