Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Maximum and minimum value bars

Hello,

          i want to display only those dimensions in bar chart whose sales are Maximum and Minimum rest i don't want to show. Is it possible?

thanks

Harlin

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi,

look at the example, i give u 2 possibility

C u,

Stefano

View solution in original post

7 Replies
Not applicable
Author

any answer to my question??

tell me alternative way if u can please

thanks

Not applicable
Author

Hi,

look at the example, i give u 2 possibility

C u,

Stefano

IAMDV
Master II
Master II

Hi Harleen,

Here is the example and explanation.

I would always use the variables in this situation. Because re-usability of variables gives you advantage in code management. So I would declare two variables...something like this :

vMaxValue

          =Max({1} Aggr( COUNT({1} OrderId),  Year))

vMaxValue

          =Min({1} Aggr( COUNT({1} OrderId),  Year))

The above variables calculate the Max & Min values across all the OrderId's. In your case you might want to use Sum(Sales) and Aggr with the dimension.

Then I would use simple IF conditional statement. Something like this...

IF(COUNT(OrderId) = (vMaxValue),  COUNT(OrderId), IF(COUNT(OrderId) = (vMinValue), COUNT(OrderId)))

I am attaching the example for your reference. Good luck!

I hope this helps.

Cheers - DV

Not applicable
Author

ste.san,

              thank u so much. Your solution works perfectly. My logic was also correct which was this

If(aggr(Sum (Netamountpaid),ProductCategoryID)=max(aggr(Sum (Netamountpaid),ProductCategoryID)),

Sum(Netamountpaid))

But i was not using total keyword as u used. I don't know the meaning of total?

but if i put max(aggr(Sum (Netamountpaid),ProductCategoryID)) in a variable then it works without total keyword.

can u explain me this confusion?

thanks

Harleen

Not applicable
Author

D V. also works well

Not applicable
Author

Hi harleen,

this is taken from the "QlikView help":

"If the word total occurs before an expression, the calculation will be made over all possible values given the current selections, but disregarding the chart dimensions"

I hope this help you.

Stefano.

Not applicable
Author

Thanks Stefano,

                           i understood now.

i am using this formula max(total aggr(Sum (Netamountpaid),ProductCategoryID))

what if i want to use Drill down group of Productcategory, then subcategory then product name in place of ProductCategoryID?

thanks

Harleen