Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

A problem with max of a field function

Hi, guys!

Please help me find a solution. I have a problem here.\

This is my table:

EmployeeDataAccountDateAccount
Pavel Kovalski1,00Nov 2014
Pavel Kovalski1,00Dec 2014
Pavel Kovalski1,00Jan 2015
Pavel Kovalski1,00Feb 2015
Kirill Abramov0,00Mar 2014
Kirill Abramov0,00Oct 2014
Kirill Abramov0,00Nov 2014
Kirill Abramov0,05Jan 2015
Kirill Abramov0,14Sep 2014
Kirill Abramov0,23Sep 2014
Kirill Abramov0,64Sep 2014
Kirill Abramov0,95Jan 2015
Kirill Abramov1,00Feb 2014

I need to find Max value of DataAccount for each month.

I try like :

Load Employee, DateAccount ,

Max(DataAccount) as Values

Resident Table2

Group By Employee, DateAccount ;

But it doesnt work, it gives me  this :" - " for each eriod . I also tried like Num#(Max(DataAccount)) or Num(Max(DataAccount)), but again no result.

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Hi Diana,

where are your datas from?

have you tried num#(DataAccount,'#,##')  ?

As I can see all datas are between 0,05 and 1, so maybe they are percentage values.

If I can't script the script edit to get calculateable values use a trick:

change the values to percentage

0,05 = 5

0,65 = 65

1,00 = 100

so that there are no commas.

load the datas and then recalculate them by devide them by 100

load DataAccount/100 as DataAccount

For this value you can calculate the max.

Regards

View solution in original post

13 Replies
jyothish8807
Master II
Master II

Hi Diana,

Try this:

aggr(max(DataAccount),DateAccount) in your straight chart.

Regards

KC

Best Regards,
KC
Not applicable
Author

Hi, Jyothish!

I need to find this max values in the load script..

martinpohl
Partner - Master
Partner - Master

Can't find an error, for me it works.

Not applicable
Author

Hi,

         You can try like this.

Table1:

Load

     Employee,

     DateAccount ,

     Values

from  ................;

Table2:

Load

     Employee,

     DateAccount ,

     Max(DataAccount) as Values

Resident Table1

Group By Employee,DateAccount ;

Drop table Table1;

Not applicable
Author

Hi, Martin!

I guess I have a problem with number format. I can't figure out how to change this format to make this work. As I mentioned above I tried Num#(Max () ) and num (Max ()).

Any suggestions?

martinpohl
Partner - Master
Partner - Master

Hi Diana,

maybe your DataAccount can't be interpreted as a number.

For that you can't calculate a max value.

How are the datas shown in a list box? right aligned or left aligned?

if left aligned QlikView thinks that the datas are a string, not a number.

In that case you have to use a syntax like this

max(num(num#(DataAccount,'#,#'))) as Value

num# defines the syntax the datas are in = decimale sting is a comma

than you have to recalulate them as a numeric field with num

and finally you can calculate the max

I can't test it on my system because for the the decimal seperator is comma

Regards

jyothish8807
Master II
Master II

Hi Diana,

Are you using a inline table? If yes then "," between numbers will create an issue.

Or try:

num(num#(Yourfield,'###,###')) as Yourfield

PFA.

Regards

KC

Best Regards,
KC
Not applicable
Author

Hi,

In script remove the comma(,) and put point(.).

Untitled.png

Anonymous
Not applicable
Author

Try this


Load Employee, DateAccount ,

Max(num#(DataAccount,'#,##')) as Values

Resident temp

Group By Employee, DateAccount ;