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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
3 Replies
Clever_Anjos
Support
Support

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

tresB
Champion III
Champion III

May be Dynamic Update is what you need.