Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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
Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Vegar_0-1630503829204.png

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

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

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])

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

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)