Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

qlikuserkv
New Contributor III

mode of quantity

Hello,

I have a table where I count The sum of quantity using variables ( min and max quantity, min and max visit)

I use this formula

Sum(

aggr(

If(


((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))


,  Quantity )

,SalesID)

)


I want to calculate the mode of quantity--- mode(Quantity)  but when I use the variables it should change appropriately


4 Replies

Re: mode of quantity

Are you checking both MinVisit variable against Sum(Quantity) or should that be Sum(Transaction)??

Sum(

aggr(

If(

((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))

,  Quantity )

,SalesID)

)


what exactly do you mean by this? Can you elaborate with an example?

"I want to calculate the mode of quantity--- mode(Quantity)  but when I use the variables it should change appropriately"

qlikuserkv
New Contributor III

Re: mode of quantity

This is Formula where I Calculate Sum Quantity and now I want to calculate Mode of this Quantity. Using same variables Than I used calculating sum of Quantities.and How can I calculate mode of Quantity restricted with this variables?

Re: mode of quantity

I am not sure I understand... would you be able to share some sample data and explain the output you are looking to get?

Re: mode of quantity

Hi, I'm not sure to understand, if you change Sum to Mode it doesn't works?

Mode(

aggr(

If(


((Sum(Quantity) >= $(MinVisit) and Sum(Transaction) < $(MaxVisit)) and (Sum(Quantity) >= $(MinQuantity) and Sum(Quantity) < $(MaxQuantity)))


,  Quantity )

,SalesID)

)

Community Browser