Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
tahreen371
Contributor III
Contributor III

How to add fields from a Column based on Selection of Other two columns.

Hello All,

I'm facing issues on a requirement plz someone help on this,

Say I have four Columns: 'Instrument_Type' and 'Industry_subgroup' and 'Exposure' and 'Net_Value'.

When any field values are selected under 'Instrument_Type' it should exclude selections from 'Industry_subgroup' and give a sum('Exposure').

The field value selections can vary for 'Instrument_Type', plz refer the sample data for reference.

Please help in achieving this.
I'm trying it with below equation but not sure how to move forward.
if(WildMatch(INSTRUMENT_TYPE,'*Bond*','*Bond Future*'),'good','bad') as INST_TYPE,

Thanks & Regards

3 Replies
Channa
Specialist III
Specialist III

if you want to exclude selection do below

=sum ( {<Instrument_Type = >} value)

 

add this in your script

 IF(INSTRUMENT_TYPE like '*Bond*' or INSTRUMENT_TYPE like '*Bond Fou*','B1','B2') as INSTRUMENT_TYPE_B,

Channa
tahreen371
Contributor III
Contributor III
Author

Hello,

but this will be a form of static expression, In future if any other fields gets added then we need to add it in script again..

 IF(INSTRUMENT_TYPE like '*Bond*' or INSTRUMENT_TYPE like '*Bond Fou*','B1','B2') as INSTRUMENT_TYPE_B,


So is there any dynamic way in achieving this??

 

Thanks & Regards

Channa
Specialist III
Specialist III

better way is to edit script than your expressions one place you edit and all dashboard you will see changes

if you use in expression also you need to edit but may be many places...changes is common..better go with script

Channa