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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ganeshreddy
Creator III
Creator III

How to write sql logic in qlikview

Hi All

Can anyone tell. how to write this SQL logic in qlikview.

MERGE INTO sale s

  2  USING (SELECT ROWID rid, sale_at, product_id

  3           FROM sale

  4          WHERE product_id IN (SELECT parent_id FROM split)

  5         UNION ALL

  6         SELECT CAST (NULL AS ROWID) rid, sale_at, child_id FROM sale

  7           JOIN split ON (parent_id = product_id)) m

  8  ON (s.ROWID = m.rid)

  9  WHEN MATCHED THEN

10     UPDATE SET s.sale_at = m.sale_at

11     DELETE WHERE 1 = 1

12  WHEN NOT MATCHED THEN

13     INSERT VALUES (m.sale_at, m.product_id);

regards,

Ganesh

3 Replies
Clever_Anjos
Employee
Employee

This command is an update-like statement, do you need to update your database or a table inside your Qvw?

ganeshreddy
Creator III
Creator III
Author

Hi Clever,

I need to update table inside qvw.

Regards,

Ganesh

tresesco
MVP
MVP

May be Dynamic Update is what you need.