Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AIShatiLove
Contributor III
Contributor III

chain conditions in qlik

Hi, i have  a table with fields id, type and sum

idtype sum
1A0.1
2A0.3
1B0.5
2B0.2
3A1.2
3B1.5
4B1

so i need  to sum values of type B whose also have A type so my result table should look like this:

idsum  only B type
10.5
20.2
31.5
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Vegar_0-1630503829204.png

Try this expression:  sum({<type = {'B'},id = P({<type={'A'}>})>}[sum])

 

View solution in original post

2 Replies
Vegar
MVP
MVP

Vegar_0-1630503829204.png

Try this expression:  sum({<type = {'B'},id = P({<type={'A'}>})>}[sum])

 

Kushal_Chawda

@AIShatiLove  another method is to create a flag in script and use it in set analysis to make expression simpler

Data:
LOAD id, 
     type, 
     sum
FROM Table;

Left Join(Data)
LOAD distinct id,
     'B' as type,
     1 as Flag
Resident Data
where type ='A';

 

Then use below expression in graph

=sum({<Flag={1}>}Amount)