Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)...
sName | sValue |
Brand | Fortinet, Inc. |
Contact | Jim |
Description | Dubai A20 |
Location | Abu Dhabi |
MACAddress | |
MACAddressVendor | Fortinet Inc. |
Model | |
Name | |
OID | |
OS | |
OSVersion | |
WAN Router | Yes |
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.
Hi,
In script
try below
DeviceAttribute:
Load sName as Location,
sValue as LocationName
from DeviceAttribute
where wildmatch(sName,'Location');
Regards
Hi Vijay,
Try like this
Data:
LOAD
*
FROM Data
WHERE sName <> 'Location';
JOIN
LOAD
sValue AS Location
FROM Data
WHERE sName = 'Location';
Regards,
Jagan.
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')
Hi Jagan,
I dont have a table as Data.. Can you please explain why we are inserting a Data table?
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.
Both sName and sValue are from same table.. Why we are joining them in 2 pieces...?
Since you want location as a separate column we are doing this.
Regards,
Jagan.
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
Hi,
Wildmatch() is QlikView Function.
If you are comparing your data in SQL query then use like or simply = as suggested by jagan.
Regards