Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings,
I'm importing 2 tables from my database that looks like this:
Key | Server | Cpu |
---|---|---|
358 | Server1 | Processor 1 Core 1 Thread 1 |
358 | Server1 | Processor 1 Core 1 Thread 2 |
360 | Server2 | Processor 1 Core 1 Thread 1 |
360 | Server2 | Processor 1 Core 1 Thread 2 |
360 | Server2 | Processor 1 Core 2 Thread 1 |
Key | Server | RAM |
---|---|---|
358 | Server1 | 8G |
358 | Server1 | 8G |
360 | Server2 | 16G |
360 | Server2 | 8G |
and i'm trying to do a table that count the number of CPU for a server and a sum of the RAM for the same server so my table would look like this:
Key | Server | Cpu | RAM |
---|---|---|---|
358 | Server1 | 2 | 16 |
360 | Server2 | 3 | 24 |
Thanks for helping!
Hi Vincent,
This task don't need any modification in load script.
Place a simple table object on the sheet, and add these dimensions: Key, Server
and these measures: =count(Cpu), =sum(num(replace(Ram,'G',''))
The tables share the Key field, therefore they are linked.
G.
Hi Vincent,
This task don't need any modification in load script.
Place a simple table object on the sheet, and add these dimensions: Key, Server
and these measures: =count(Cpu), =sum(num(replace(Ram,'G',''))
The tables share the Key field, therefore they are linked.
G.
TABLE1:
LOAD Key,
Server,
Cpu
FROM
[Your directory here]
(ooxml, embedded labels, table is Sheet1);
TABLECPU:
LOAD Key,Server,Count(Cpu) as [Number of CPU's]
Resident TABLE1
Group by Key,Server;
drop table TABLE1;
TABLE2:
LOAD Key,
Server,
MID(RAM,1,Len(RAM)-1) as RAM
FROM
[your directory here]
(ooxml, embedded labels, table is Sheet2);
TABLERAM:
LEFT JOIN (TABLECPU)
LOAD Key,Server, sum(RAM) as RAM
Resident TABLE2
group by Key,Server;
drop table TABLE2;