Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

guitartrova
Contributor III

Sum if multiple Qlik Sense

I have the challenge, I have a field called "TIPOMEDICION" that has two values ​​"official" and "backup", I am using the dimension called "PUNTOSIMEC".


It turns out that I have data from the official pointsimec and backup, but sometimes I only have data from the official and not from the backup or vice versa, the challenge is that when there is data in the official pointsimec I add the data, but if there is data that adds me the data of the Puntosimec backup.


For this example I have two points loaded 40-4-81 & 40-82 but I do not have data from the official pointsimec of 40-4-82 but I need to add the data of the backup to complement.


I hope you have made me understand.


Current expression

SUM(If([TIPOMEDICION] ='OFFICIAL' AND [KWHR]>0,[KWHR]/1000))

simec.png

simec2.png

1 Solution

Accepted Solutions
sibin_jacob
Contributor III

Re: Sum if multiple Qlik Sense

Try this one in the expression


if(SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])>0,

SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])/1000,

SUM({<[TIPOMEDICION] ={'BACKUP' }>}[KWHR])/1000)

4 Replies
bwisealiahmad
Valued Contributor

Re: Sum if multiple Qlik Sense

Hi,

I am not sure if I understand entierly, but you want to add data from the official and if there is backup data you also want to add this?

Best,

Ali A

sibin_jacob
Contributor III

Re: Sum if multiple Qlik Sense

Try this one in the expression


if(SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])>0,

SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])/1000,

SUM({<[TIPOMEDICION] ={'BACKUP' }>}[KWHR])/1000)

MVP
MVP

Re: Sum if multiple Qlik Sense

You can also try this

RangeSum(

Sum({<PUNTOSIMEC = {"=SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])>0"}, [TIPOMEDICION] ={'OFFICIAL'}>} [KWHR]/1000),

Sum({<PUNTOSIMEC = {"=SUM({<[TIPOMEDICION] ={'OFFICIAL' }>}[KWHR])=0"}, [TIPOMEDICION] ={'BACKUP'}>} [KWHR]/1000))

guitartrova
Contributor III

Re: Sum if multiple Qlik Sense

Thanks Sibin , it works.

Community Browser