8 Replies Latest reply: Oct 31, 2017 3:19 AM by Shraddha Gajare

# How to use max() function in qliksense?

How to use max() function with where clause in load editor in Qliksense ??

where Quarters=Max(Quarters)

Getting error in above expression.

Kindly help.

• ###### Re: How to use max() function in qliksense?

You cannot reference Quarters and Max(Quarters) in the same load statement. You will need to do this in two steps -- the process will depend in the structure of your data and whether you want a global max or a max by some grouping.

• ###### Re: How to use max() function in qliksense?

I need to calculate the max value of quarter and use it in the measure.

How do I do it.?
Is there any way to calculate in the expression??

• ###### Re: How to use max() function in qliksense?

>>the process will depend in the structure of your data and whether you want a global max or a max by some grouping.

The more detail you provide, the more useful the suggestions.

• ###### Re: How to use max() function in qliksense?

you can directly use that condition in set analysis if you have calculated Quarter field in your calendar script

• ###### Re: How to use max() function in qliksense?

The expression I m using in the expression editor is:

count( Quarter=max(Quarter) distinct [Customer Group])

But its not working fine.

• ###### Re: How to use max() function in qliksense?

Try,

count( distinct  {<Quarter={"\$(=max(Quarter))"} >} [Customer Group])

• ###### Re: How to use max() function in qliksense?

I need to calculate the measure which should represent the data as per the maximum value of quarter.

The expression for the measure is:
count(distinct [Customer Group])

The expression I am trying in expression editor is :

count( Quarter=max(Quarter) distinct [Customer Group])

But not getting the desired result.

Kindly help.