Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

script problem

Dear All,

How to user this SQL query in qlikview script :

Select Level00,

  Level02,

(

  SELECT TOP 1 Level2

  FROM demo m

  WHERE m.ProductCode = tb.ProductCode

  AND (

  m.StoreCode = sm.StoreCode

  OR m.StoreCode IS NULL

  )

  AND m.CreatedDate <= tb.CreatedOn

  ELSE 1 END)

  ORDER BY m.CreatedDate DESC

  ) AS 'Level2'

FROM dbo.User(NOLOCK) umr

INNER JOIN tempDemo tb ON tb.ModuleID = srm.ModuleID

Please reply..

Rahul

4 Replies
crusader_
Valued Contributor

Re: script problem

Hi,

Create ODBC (OLE DB) connection to your database.

And use below script:

Table:

LOAD *

;

SQL

Select Level00,

  Level02,

(

  SELECT TOP 1 Level2

  FROM demo m

  WHERE m.ProductCode = tb.ProductCode

  AND (

  m.StoreCode = sm.StoreCode

  OR m.StoreCode IS NULL

  )

  AND m.CreatedDate <= tb.CreatedOn

  ELSE 1 END)

  ORDER BY m.CreatedDate DESC

  ) AS 'Level2'

FROM dbo.User(NOLOCK) umr

INNER JOIN tempDemo tb ON tb.ModuleID = srm.ModuleID;

Hope this helps.

Regards,

Andrei Kaliahin

Highlighted
Not applicable

Re: script problem

thanks for reply but i am working on qvd so i have to create logic .

I can't fetch this from DB.

crusader_
Valued Contributor

Re: script problem

Hm...

So each table from DB converted into QVD ?

Am I right?

Andrei

Not applicable

Re: script problem

yes...