# App Development

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for
Did you mean:
Creator III

## expression to exclude and include in chart

Delta code value is 001,002,003,004

Source field Value is   AAA,BBB,CCC

Sum({<[Delta Code]={'0*'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People])

how to edit this expression ,

if source Field is AAA then use 002 for no of people otherwise use all delta code

thansk

Labels (2)

• ### Expression

1 Solution

Accepted Solutions
Partner
You could use an if statement.
If (Field='AAA',
Sum({<[Delta Code]={'002'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People]),
Sum({<[Delta Code]={'0*'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People])
)
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
3 Replies
Contributor II
Hi,
Try something like this:
Pick(Match([Your Source field],'AAA')+1,Sum({<[Delta Code]={'0*'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People]),
Sum({<[Delta Code]={'002'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People]))
Partner
You could use an if statement.
If (Field='AAA',
Sum({<[Delta Code]={'002'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People]),
Sum({<[Delta Code]={'0*'},[Departure Year]={"\$(=Max([Departure Year]))"}>}[People])
)
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Creator III
Author
Thanks
Tags
Community Browser