How to Match the values based on List Range ???

pskannaapskannaa Member Posts: 138
Hi,

Plz Provide me simple solution for the below query...

"Qty" field in Header
"Min", "Max", "Size" fields in Line


Eg:

Line Items
Min Max Size
1 5 2
5 10 4
10 20 8

If my "Qty" value is 4 it should be return "Size = 2"
If my "Qty" value is 8 it should be return "Size = 4"
If my "Qty" value is 16 it should be return "Size = 8"
If my "Qty" value is 22 it should be return "NO Size for the Qty"



Regards,
Psk

Comments

  • garakgarak Member Posts: 3,263

    Line Items
    Min Max Size
    1 5 2
    5 10 4
    10 20 8

    If my "Qty" value is 4 it should be return "Size = 2"
    If my "Qty" value is 8 it should be return "Size = 4"
    If my "Qty" value is 16 it should be return "Size = 8"
    If my "Qty" value is 22 it should be return "NO Size for the Qty"

    is the "qty" ever "qty" := size * 2; or other formula Size := "qty" / 2;?

    If yes, you have your solution how to get the right line (for example if you need to filter the line) ;-)

    Regards
    Do you make it right, it works too!
  • pskannaapskannaa Member Posts: 138
    Oh no...

    Size of Qty is not like that it may be 1,7,12,13,19 etc..

    we can't cal like size * 2 like....

    I want to match the Qty in each line of statements(min,max) and get the corresponding size
  • garakgarak Member Posts: 3,263
    edited 2009-03-06
    pskannaa wrote:
    Oh no...

    Size of Qty is not like that it may be 1,7,12,13,19 etc..

    we can't cal like size * 2 like....

    I want to match the Qty in each line of statements(min,max) and get the corresponding size

    Sorry, now i'm confused and i doesn't understand this post when i read also the first post here......

    if it is depending on the field (max) then set a filter to setfilter(max,'>=%1',qty);
    Do you make it right, it works too!
  • MBergerMBerger Member Posts: 413
    pskannaa wrote:
    Oh no...

    Size of Qty is not like that it may be 1,7,12,13,19 etc..

    we can't cal like size * 2 like....

    I want to match the Qty in each line of statements(min,max) and get the corresponding size
    If the ranges always have to be continuous, i'd first loose either of the MIN or MAX values, because there's simply no need for it. It also makes it easier to change or insert a range, because you don't have to change anything on other records.

    After that, selecting the record you want is easy..
    - If you only have MAX left you just SETFILTER ( Max,'>=',Qty) and then FINDFIRST.
    - If you only have MIN left you just SETFILTER ( MIN, '<=',Qty) and then FINDLAST.
  • pskannaapskannaa Member Posts: 138
    Yea Got it !! It's matching your SetFilter() eg.

    Thanks buddy !!
Sign In or Register to comment.