Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

How I can set a variable with value given from more table

Hello,

I have N tables with the same format, and how I want is set a Variable that will be the sum of the Column X with a particular condition.

Immagine1.pngImmagine2.png

I would like to set in Edit script vTotAge from all table that I have.

Somethings like this :

if(Nome='Pippo') then Sum(Age) from Table1   as TotTab1;

if(Nome='Pippo') then Sum(Age) from Table2 as TotTab2;

..

..

if(Nome='Pippo') then Sum(Age) from TableN as TotTabN;


vTotAge = TotTab1+ TotTab2+...+ TotTabN

Someone have a Solution for my Problem.

Thanks in advances

4 Replies
pascos88
Creator II
Creator II
Author

If someone can advise me other solutions for this it is good anyway..

Anonymous
Not applicable

Well, if you have N tables with same format, would suggest do the caoncatenation of all the tables and make it one and then try sum(Age)..

Else do something like: aggr(sum(Age),Nome)

Kushal_Chawda

First Concatenate all the tabels

Load Nome,

        sum(Age) as Age

From table1

group by Nome

concatenate

Load Nome,

        sum(Age) as Age

From table2

group by Nome



Now you can simply write expression in Chart as sum(Age)

Mark_Little
Luminary
Luminary

Hi,

As stated by the people above, I would advise that you concatenate the tables together.

I would add a new field like

'Table1' As Table

So if needed you can pick out values from individual tables.

Mark