cancel
Showing results for 
Search instead for 
Did you mean: 

RE: [personal kdb+] Select a column mapped to a username

david_demner
New Contributor
X-Originating-IP: 174.7.132.159User-Agent: Workspace Webmail 5.15.9Message-Id: <20151029072108.85f80dae80d1d2f2e266ec6278e6cbe8.096f6de106.wbe@email07.europe.secureserver.net>From: "David Demner \(AquaQ\)" To: personal-kdbplus@googlegroups.comSubject: RE: [personal kdb+] Select a column mapped to a usernameDate: Thu, 29 Oct 2015 07:21:08 -0700Mime-Version: 1.0
Use #:

q)t:([]DAVID:();JOE:())
q)(1#upper .z.u)#t
DAVID
-----



-------- Original Message --------
Subject: [personal kdb+] Select a column mapped to a username
From: Roni Hoffman <hoffmanroni@gmail.com>
Date: Thu, October 29, 2015 7:13 am
To: Kdb+ Personal Developers <personal-kdbplus@googlegroups.com>

I have table with columns for users.

ie. t:([]Dave:`$();Nick:`$())

I am wondering how to dynamically select the column that matches the current username using .z.u

I will have to consider string cases, using something like `$ssr[string .z.u;string .z.u;upper] to cast the entire username to upper and match it against the column name casted to upper as well.

Any ideas?


--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
3 REPLIES 3

hoffmanroni
New Contributor III
Thanks David

hoffmanroni
New Contributor III
Hmm sorry quick question, I am trying to pull a second column using that dynamic column name but not sure the syntax

exec Col from (`Col;upper .z.u)#t where upper .z.u=1b

results in type error

Never mind got using functional select.  Thanks.