Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Spiller
Contributor III
Contributor III

Set Analysis - how to make calculation based on on the value of one field

Hi all,

For a user story I need to measure if TaksX for the project has been completed on time or not. Currently it looks like below in set analysis. Only we have a new condition now where it should always check the BaselineDate and Delta for BaselineSource A first, when that source is available for project TaskX. If not then it should use the date and delta from source B for the calculation. How can i do that in an easy way?

Current script:

=Sum({<

TaskName = 'TaskX'
,BaselineName = 'BaselineX'
,BaselineDateCalendarYear = {'$(vF_CurrentYear)'}
,BaselineDate = {"<$(=Today())"}
,BaselineSource = {'A', 'B'}
>}
Aggr(If(Max({<

TaskName = 'TaskX'
,BaselineName = 'BaselineX'
,BaselineDateCalendarYear = {'$(vF_CurrentYear)'}
,BaselineDate = {"<$(=Today())"}
,BaselineSource = {'A', 'B'}
>} BaselineDelta ) <= Threshold
,1
), ProjectID)
)

Labels (2)
1 Reply
edwin
Master II
Master II

without knowing more details, i would say create a new field in your script where you check for those conditions.  that way you dont create nested if statements in your expressions.