Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
siddharthsoam
Partner - Creator II
Partner - Creator II

Can we put condition in max function

Hi

I want to apply a condition in max function.

Max({<[Fiscal Year]='FY16'>}( mid(Quarters,2)))

Ideally it should give me 4, but its not returning any value.

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

have a look at the attached.

View solution in original post

75 Replies
devarasu07
Master II
Master II

Hi,

You have missed that curly bracket, just add like below try again. tks

Max({<[Fiscal Year]={'FY16'}>}(mid(Quarters,2)))

siddharthsoam
Partner - Creator II
Partner - Creator II
Author

Sorry Devarasu forgot that but I am still facing another problem. The following max condiotion is not working in the expression with concat

Concat(Distinct 'Q' & if( (( mid(Quarters,2))-1)>0 and [Fiscal Year]='FY17', ( mid(Quarters,2))-1, (Max({<[Fiscal Year]={'FY16'}>}(mid(Quarters,2))))),',')

Its showing nested aggregation not allowed.

shraddha_g
Partner - Master III
Partner - Master III

what are you trying to do here?

siddharthsoam
Partner - Creator II
Partner - Creator II
Author

Hi Shraddha,

I have my quarters as Q1,Q2,Q3,Q4 so I am generating previous quarters for the respective selection. Mid function is used to fetch 1 from Q1. For Q0 it should show me quarter 4 or the maximum quarter for year FY16

shraddha_g
Partner - Master III
Partner - Master III

do you have access to script?and do you have date field in data model?

siddharthsoam
Partner - Creator II
Partner - Creator II
Author

Yes I have access to script , I don't have any date field in data model

pradosh_thakur
Master II
Master II

Hi sidharth

do you want only the previous quarter for the date selected in a text box or something. This doesn't need to be this complicated. Can you share the input and expected output.

regards

Pradosh

Learning never stops.
shraddha_g
Partner - Master III
Partner - Master III

MonthField?

siddharthsoam
Partner - Creator II
Partner - Creator II
Author

Yes I have a month field