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

Count with Mode function

Hi

I am using the mode function to find out the item which was ordered many times with the same quantity during the project life cycle.

The expression that I used to compute the mode is

= mode  (aggr (sum(Quantity), Project, Item))

I need the count of mode in the aggregate output.

I am using this the above expression in the chart and I need to know how much percentage that the same quantity is used in the project.

Please help.

Regards

Mohamed Abubakker



33 Replies
Not applicable
Author

Mohamed,

In my previous example i think you expect result 2 for I1.

Let me know how isnull is able to help in it?

27-04-2014 13:59 użytkownik "Mohamed Abubakker" <qcwebmaster@qlik.com>

napisał:

Qlik Community <http://community.qlik.com/> Count with Mode

function

reply from Mohamed Abubakker<http://community.qlik.com/people/mabubakker?et=watches.email.thread>in

Scripting - View the full discussion<http://community.qlik.com/message/516846?et=watches.email.thread#516846>

Not applicable
Author

Darek,

I am using the below expression to avoid nulls.

if (isnull(mode(....), max(), mode(...))

Not applicable
Author

And your expression will give 1 in this case:

P1,I1,3

P1,I1,3

P2,I1,3

P3,I1,4

Please show me exact formula you use.

Regards

Darek

27-04-2014 14:16 użytkownik "Mohamed Abubakker" <qcwebmaster@qlik.com>

napisał:

Not applicable
Author

Mohamed,

Iam still outside, but please check this idea:

Max(aggr(count(sum(ammount)),project,item))

On item level of chart it Should give what you expect.

U think, If you are on item level, you may even use only project as

dimension of aggr.

Please let me know If it gives expected result.

Regards

Darek

27-04-2014 14:16 użytkownik "Mohamed Abubakker" <qcwebmaster@qlik.com>

napisał:

Not applicable
Author

Attachment contains the exact formula.

Not applicable
Author

Hi

The text box should return 5 because in Project-B total of two quantities has been issued.

Not applicable
Author

Please check the attachment.

Text box should return 5.

Not applicable
Author

I still have only phone, so i cant open attachment now:(

But please think about idea from my previous post. In fact in this

expression you are not interested what is mode value but what is max

occurence

Regards

Darek

27-04-2014 15:10 użytkownik "Mohamed Abubakker" <qcwebmaster@qlik.com>

napisał:

Qlik Community <http://community.qlik.com/> Re: Count with Mode

function

reply from Mohamed Abubakker<http://community.qlik.com/people/mabubakker?et=watches.email.thread>in

Scripting - View the full discussion<http://community.qlik.com/message/516855?et=watches.email.thread#516855>

Not applicable
Author

Thank you Liron. It works perfect.

Not applicable
Author

Mohamed,

as i understood, you need to have results on Item level (in chart with Item as dimension).

If yes, i'am afraid, Lirons expression may not work as you expect.

I loaded one more Item (Item B) and put Item as dim and expression from Liron as expression in this chart ...

Please, let me know if you still would like to find solution for chart with Item as dimension.

regards

Darek