Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. $300 savings extended to February 9th Learn More
Highlighted
vincent_bellang
New Contributor III

Sum of a table

Greetings,

I'm importing 2 tables from my database that looks like this:

KeyServerCpu
358Server1Processor 1 Core 1 Thread 1
358Server1Processor 1 Core 1 Thread 2
360Server2Processor 1 Core 1 Thread 1
360Server2Processor 1 Core 1 Thread 2
360Server2Processor 1 Core 2 Thread 1
KeyServerRAM
358Server18G
358Server18G
360Server216G
360Server28G

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:

KeyServerCpuRAM
358Server1216
360Server2324

Thanks for helping!

1 Solution

Accepted Solutions
undergrinder
Valued Contributor II

Re: Sum of a table

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.

View solution in original post

2 Replies
undergrinder
Valued Contributor II

Re: Sum of a table

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.

View solution in original post

qlikmeplease
Contributor III

Re: Sum of a table

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;