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

Max function

If I have 12 months in separate columns, and I want to find the highest sales amount by month? how would I do this?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

No. Inline is used to take sample data. You can replace the inline part like:

Crosstable(Months, Values, 1)

Load * From <YourDatasource>;

View solution in original post

14 Replies
Not applicable
Author

Hi Daniel

If you are using a straight table and these the months are split by dimension (i.e. you only have one expression) then under expressions the Total Mode can be switched to Max which will give you what you need. 

Otherwise there are plenty of threads on this subject, I think the one below would be useful;

Another max row question

I hope this helps


Steve

Not applicable
Author


Hi Thanks for your help, My problem is slightly different I think as my table looks like the below


 

Entity


 

 

JAN


 

 

FEB


 

 

MARCH


 

 

JUNE


 

 

JULY


 

 

AUG


 

 

A


 

 

0


 

 

0


 

 

0


 

 

10


 

 

0


 

 

0


 

 

B


 

 

5


 

 

0


 

 

0


 

 

2


 

 

10


 

 

0


 

 

C


 

 

15


 

 

0


 

 

5


 

 

0


 

 

0


 

 

0


 

I want to be able just have a text box probably that dsiplays 15 as the max, is this possible??

sujeetsingh
Master III
Master III

Wale ,

i have some queries

--You want it to be displayed in UI level .

--or you want it to done in scripting.

Not applicable
Author

I want it to be at UI level

but if its possible in scripting as well that is fine as long as I get to the answer in the end.

Not applicable
Author

You can use max function with Sum(Total (Field)).

Total() is the function which avoid the effect of dimesions as you want that 15 is not affected by the dimensions in the straight table.

Not applicable
Author

Thanks, I am still a bit confused of what the expression would look like, could you give me an example using the headers from the above table please?

tresesco
MVP
MVP

Hello Daniel,

Use crosstable() to upload the data like: Crosstable (Month, Amount,1) Load * from <Your Data source>;

Then use expression: =Max(Amount) in a text object.

Sneha Topre, I am sorry to poke again, but, total is not a function, it's a qualifier/keyword. So you can't write like:

Sum(Total(Field))), but, = Sum(Total field)

Update: PFA

Not applicable
Author

Thanks tresesco to correct me,Yo are correct in saying its a Keyword, i used it forgot exact syntax..

sujeetsingh
Master III
Master III

See this sample  for reference,