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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use max() without make any selection

Hi,

I want to use this expression IF(Month=max(Month), WorkingDays) in a chart, and I want to get workingdays for the max month without make any selection.This expression works fine if there are selections but doesn;t work if there are no selections.

Am I missing something?

Regards,

Helen

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Try the third one...

Update : Have you tried this?

=Max({<Month = {'$(=Max(Month))'}>}WorkingDays)


Try this one also...


=FirstSortedValue(WorkingDays,-Month)

View solution in original post

7 Replies
MK_QSL
MVP
MVP

=IF(Aggr(Month,WorkingDays)=max(TOTAL Aggr(Month,WorkingDays)), WorkingDays)

UPDATE...

Use below..

=Max(Aggr(IF(Month = Max(Month), WorkingDays),Month,WorkingDays))

Another Way... Looks OK to me...

=Max({<Month = {'$(=Max(Month))'}>}WorkingDays)

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The IF() will only work if you select a single Month value. In all other cases, the left-hand Month will return a list of values that cannot be compared to Max(Month).

What is it you want to display, and where do you want this to be displayed?

Best,

Peter

hic
Former Employee
Former Employee

It doesn't work when there are several values of Month or WorkingDays possible. See It's all Aggregations. You need to specify what the expression should show in such a case, by using an aggregation function.

HIC

Not applicable
Author

Hi Manish,

If you try to apply these expression to the sample I have upload you will see that the first is not working at all and the second returns the max number of workingdays (30) and not the workingdays for the max month (21).....

Not applicable
Author

So, there is no way to get WorkingDays for the max month if there are no selections on month field?

It's such a simple expression and I am prety sure that was used to be working fine in previous versions of QlikView (7,8 and olders)

MK_QSL
MVP
MVP

Try the third one...

Update : Have you tried this?

=Max({<Month = {'$(=Max(Month))'}>}WorkingDays)


Try this one also...


=FirstSortedValue(WorkingDays,-Month)

Not applicable
Author

Thank you Manish,

your last two suggestions work both perfect for my case.

Regards,

Eleni