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: 
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

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
Community Manager
Community Manager

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

Sue Macaluso