Skip to main content
Answer

asset-timeseries mapping issue

  • June 26, 2024
  • 2 replies
  • 54 views

Forum|alt.badge.img+6

I have a dataset which consists of Assets.
and another dataset which consists of timeseries.

I wanted to map assets to timeseries 
But ,i am getting access issues.
FYI.
We have been given all required access (i.e. read and write).

 


Query:

WITH assets AS (
    SELECT  id,name
    FROM _cdf.assets
    where dataSetId = dataset_id("test_assets")
),
tagname AS (
  select tagname as tagname,
  name as assetName
  FROM `test_assets`.assets
),
time_series AS (
    SELECT name, externalId 
    FROM _cdf.timeseries 
  where dataSetId = dataset_id("test_timeseries")
)
SELECT  ts.name, a.id AS assetId
FROM tagname t 
INNER JOIN assets a ON a.name=t.assetName
INNER JOIN time_series ts ON ARRAY_CONTAINS(t.tagname, (REPLACE(SUBSTRING(ts.externalId FROM 14), '.Value', '')))

Thanks in Advance.
Please give suggestion for above issue

Best answer by Dilini Fernando

Hi @Sumedh Vaidya,

After adding the necessary access to the user account, I trust that the issue has been successfully resolved.

2 replies

Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2

Hi @Sumedh Vaidya,

I have created a support ticket, so our team can follow up and help you. 


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • Answer
  • July 8, 2024

Hi @Sumedh Vaidya,

After adding the necessary access to the user account, I trust that the issue has been successfully resolved.