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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

Minumal value with certain criteria

Hello!

The problem is...

I have the chart in my qlikview report:

     

NumberNameTypeQPrice
1913654GAIDA SIAC-AULIKA 80
1913654GAIDA SIAC-PHEDRA177
1913654GAIDA SIAC-PHEDRA350
1913654GAIDA SIAC-PHEDRA445
1913654GAIDA SIAC-PHEDRA50

I can make an agrregation function to get minimal value for each Type:

=Aggr(MAX(Price,),Type) - the result is:

      

NumberNameTypeQPriceAggre
1913654GAIDA SIAC-AULIKA 8080
1913654GAIDA SIAC-PHEDRA17777
1913654GAIDA SIAC-PHEDRA35077
1913654GAIDA SIAC-PHEDRA44577
1913654GAIDA SIAC-PHEDRA5077

Now,

I need to get similar formula to get MAX value for TYPE, where Q <=3 The result should be:

      

NumberNameTypeQPriceAggre
1913654GAIDA SIAC-AULIKA 8080
1913654GAIDA SIAC-PHEDRA17750
1913654GAIDA SIAC-PHEDRA35050
1913654GAIDA SIAC-PHEDRA44550
1913654GAIDA SIAC-PHEDRA5050

How can I make such function??

Thank you in advance!!

1 Solution

Accepted Solutions
sunny_talwar

How about this:

Max(TOTAL <Type> {<Q = {"<=3"}>} Price)

View solution in original post

12 Replies
sunny_talwar

How about this:

Max(TOTAL <Type> {<Q = {"<=3"}>} Price)

sculptorlv
Creator III
Creator III
Author

didn't got it .. why Total?

Now I get error in calculated dimansions

My currnet function is:

=Max(TOTAL <FA_Class> {<Min_Quantity = {"<= 3"}>} Price)

sunny_talwar

You are doing this in the dimension or is this an expression?

sculptorlv
Creator III
Creator III
Author

I use straitght table chart.

And I tried to do this in the dimension..

Tried in the expressin = '-'

sunny_talwar

Why not use it as an expression?

sculptorlv
Creator III
Creator III
Author

Yes, I did it in expression after your previous comment! Thank you!

One more quastion... I have some valule not filled (= null()), but for my calculation this mean = 0.

How can I modify this eaquation:

=Max(TOTAL <FA_Class> {<Min_Quantity = {"<= 3"}>} Price)


so it calculate null() as =0


something like:

OR Min_Quantity = null()

sunny_talwar

Try this may be:

=Max(TOTAL <FA_Class> {<Min_Quantity = {"<= 3"}>+<Min_Quantity -= {'*'}>} Price)

sculptorlv
Creator III
Creator III
Author

ff.jpg

is it ok -= ?

Doesn't work

aa.jpg

I need to get this 45 value also for C- Aulika

where can I read about this syntaxis?

sunny_talwar

Lets try one more time

=Max(TOTAL <FA_Class> {<Min_Quantity = {"<= 3"}> + <FA_Class = {"=Len(Trim(Min_Quantity)) ="}>} Price)


=Max(TOTAL <FA_Class> {<Min_Quantity = {"<= 3"}> + <FA_Class = {"=Len(Trim(Concat(DISTINCT Min_Quantity))) = 0"}>} Price)