Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikuserkv
Contributor III
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
sunny_talwar

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
Contributor III
Contributor III
Author

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?

sunny_talwar

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

rubenmarin

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)

)