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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help in extracting a field

I have a table name Device Attributes

I have 2 column in this table sName and sValue

When I brought this table in QlikView, below is the result. So sName and right side is their results. I need Location from sName as a separate field / column. (So I will be having a new column as Location and its result would be Abu Dhabi)...

  

sNamesValue
BrandFortinet, Inc.
ContactJim
DescriptionDubai A20
LocationAbu Dhabi
MACAddress
MACAddressVendorFortinet Inc.
Model
Name
OID
OS
OSVersion
WAN RouterYes
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Rename table name Data with your corresponding table.

Data:

SELECT

*

FROM YourTableName

WHERE sName <> 'Location';

JOIN

SELECT

sValue AS Location

FROM YourTableName

WHERE sName = 'Location';


Regards,

Jagan.

View solution in original post

10 Replies
PrashantSangle

Hi,

In script

try below

DeviceAttribute:

Load sName as Location,

          sValue as LocationName

from DeviceAttribute

where wildmatch(sName,'Location');

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jagan
Partner - Champion III
Partner - Champion III

Hi Vijay,

Try like this

Data:

LOAD

*

FROM Data

WHERE sName <> 'Location';

JOIN

LOAD

sValue AS Location

FROM Data

WHERE sName = 'Location';


Regards,

Jagan.

Anonymous
Not applicable
Author

Hi Max,

I am getting an error as ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: 'wildmatch' is not a recognized built-in function name. SQL SELECT nDeviceID, sName, sValue FROM WhatsUp.dbo.DeviceAttribute where wildmatch(sName,'Location')

Anonymous
Not applicable
Author

Hi Jagan,

I dont have a table as Data.. Can you please explain why we are inserting a Data table?

jagan
Partner - Champion III
Partner - Champion III

Hi,

Rename table name Data with your corresponding table.

Data:

SELECT

*

FROM YourTableName

WHERE sName <> 'Location';

JOIN

SELECT

sValue AS Location

FROM YourTableName

WHERE sName = 'Location';


Regards,

Jagan.

Anonymous
Not applicable
Author

Both sName and sValue are from same table.. Why we are joining them in 2 pieces...?

jagan
Partner - Champion III
Partner - Champion III

Since you want location as a separate column we are doing this.

Regards,

Jagan.

awhitfield
Partner - Champion
Partner - Champion

From you details above, sName is the Name of the field you are populating and sValue is the value that you are adding to the sName Field.

Not sure what your issue actually is, can you post a sample of your data and example .qvw

Andy

PrashantSangle

Hi,

Wildmatch() is QlikView Function.

If you are comparing your data in SQL query then use like or simply = as suggested by jagan.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂