Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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)
)
Highlighted

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? 

Highlighted
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