Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
anirudhrao92
Contributor II
Contributor II

Max and if not working

Hi Iam Doing a set analysis i have a isssue 

when iam using this it is working 

Max({<ServiceDayNum={">=$(=Max(ServiceDayNum)-6) <=$(=Max(ServiceDayNum))"}>}OTPDenominator)

 

When i put in If condition like this it is not working

=If(GetSelectedCount(PeakType)=0

, Max({<PeakType={'Peak'},ServiceDayNum={">=$(=Max(ServiceDayNum)-6) <=$(=Max(ServiceDayNum))"}>}OTPDenominator)
, Max(OTPDenominator)

)

 

Can you Suggest me Answer

Thanks

 

3 Replies
parthesh
Creator
Creator

Can you please try below expression and let me know it works for you or not.

=If(GetSelectedCount(PeakType)=0
,if(PeakType='Peak' and (ServiceDayNum >= Max(ServiceDayNum)-6 and ServiceDayNum < Max(ServiceDayNum)),Max(OTPDenominator) ) , Max(OTPDenominator)
)
sunny_talwar
MVP
MVP

First thing, you have tested this expression

Max({<ServiceDayNum={">=$(=Max(ServiceDayNum)-6) <=$(=Max(ServiceDayNum))"}>}OTPDenominator)

but you are using this in your if statement (with additional set analysis on PeakType)

Max({<PeakType={'Peak'},ServiceDayNum={">=$(=Max(ServiceDayNum)-6) <=$(=Max(ServiceDayNum))"}>}OTPDenominator)

Secondly, it might help to know what you are getting and what you are expecting to see? 

Sue_Macaluso
Former Employee
Former Employee

@anirudhrao92  Are you using Qlik Sense or View? I would like to move this into the correct product forum. 

Did you find a solution to your question? Mark the solution as accepted : and if you found it useful, press the like button!