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

Some problems

Hi everyone,

I just started working with Qlikview and I have some problems i can't resolve.

1 - I am trying to use this function (

=



Sum(If(lDaysOverTime = Mode(lDaysOverTime),1))



) but does not work, instead if I replace the (Mode(lDaysOverTime)) into a number ex. 7 the function returns me the number of times that number 7 appears on the feed. What is the problem here?

2 - The function Mode() only returns a value if there is just one most repeated value. Is there a way to workaround this? I have tryied to use de aggr function but it seems i can't get it right. (

=



concat(aggr( count(lDaysOverTime), lDaysOverTime ))



).

Can you help me with this two problems?

Thanks in advance.

João Silva

3 Replies
Not applicable
Author

When I look at the definition of Mode(), it shows that it is used in a LOAD script, not an expression in a chart.

You could add this function into the load script to create a field with the number you want and use that field in an expression.

Not applicable
Author

Thanks Mark but as you can see mode can be used in chart:

Returns the mode value, i.e. the most commonly occurring value, of expression or field iterated over the chart dimension(s). If more than one value is equally commonly occurring, NULL is returned. Mode can return numeric values as well as text values.

And I need to use it on the chart so values can change according the user selection.

Can anyone help me plz?!

Not applicable
Author

Oops, you are right, there are two usages of Mode() 🙂

I am not sure how mode() works yet ...