Here is a simple approach:

for =: #~

age =: ?20#100

sex =: ?20#2

weight =: 100+?20#100

id =: 10000+?20#5000

or =: +.

and =: *.



id

14652 14290 14262 13100 11264 11129 11414 10030 11792 12598 14282 13212
14154 11130 11584 11355 13035 14807 11608 10123

id for age > 70

11129 12598 14282 13212 14154 11130 13035 11608 10123

id for (age > 70) and weight < 150

11129 13212 13035 11608

On Tue, Apr 30, 2019 at 4:26 PM Linda Alvord <lindaalvor...@outlook.com>
wrote:

>
>  ]a=:2+i.9
> 2 3 4 5 6 7 8 9 10
>
>    (6<a)#a
> 7 8 9 10
>
>
>    f=: 13 :'(x<y)#y'
>
>    6 f 2 + i.9
> 7 8 9 10
>
>
> I find it is  helpful to plan for similar problems in the  future.
>
> Surprise!
>  f
> < # ]
>
>
> Linda
>
>
> Sent from my Verizon, Samsung Galaxy smartphone
>
>
> -------- Original message --------
> From: 'Pascal Jasmin' via Programming <programm...@jsoftware.com>
> Date: 4/30/19 9:08 AM (GMT-05:00)
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] How to get actual values instead of booleans
> from a list?
>
>
>
> (#~ >&6) (2+i.9)
>
> 7 8 9 10
>
>
>
>
> On Tuesday, April 30, 2019, 9:06:26 a.m. EDT, JmageK <jma...@tuta.io>
> wrote:
>
>
>
>
>
> NB. Want it to return all numbers larger than 6 from list
>
>    (>&6) (2+i.9)
> NB. Actual result 0 0 0 0 0 1 1 1 1
> NB. desired result 7 8 9 10
>
>
> I searched but could not find what to do next to have it return only those
> numbers which pass the comparison (1 1 1 ).
>
> JmageK
> --
> Securely sent with Tutanota
> ----------------------------------------------------------------------
> For information about J forums see
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C9a5191c4a160483bef6e08d6cd6cfc29%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636922265297351670&amp;sdata=Yqus%2F7M%2B1ylqRkam2Y1QkO70ufYgBcS02Ys2zZVqqPE%3D&amp;reserved=0
> ----------------------------------------------------------------------
> For information about J forums see
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C9a5191c4a160483bef6e08d6cd6cfc29%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636922265297351670&amp;sdata=Yqus%2F7M%2B1ylqRkam2Y1QkO70ufYgBcS02Ys2zZVqqPE%3D&amp;reserved=0
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to