Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator II
Creator II

How to implement sql query in Qlikview script . Need Help

Hi All ,

Please see my MySql Query .

select

   distinct dealer.id as dealer,

   supplier.id as supplier,

       dealer.name as dealername,

       supplier.name as suppliername,

       Month(date_updated) as month,

   Year(date_updated) as year     

from VAF5.aux_institutionfspconfig ifspc

inner join VAF5.institution dealer on dealer.id = ifspc.institution2_id

inner join VAF5.institution supplier on supplier.id = ifspc.institution1_id

left join VAF5.deal deal on deal.institution_id = ifspc.institution1_id

#and  deal.dealgroup_id  in (select dealgrp.id from VAF5.dealgroup dealgrp)

and dealer.id  not in (select distinct dealgrp1.institution_id from VAF5.dealgroup dealgrp1 inner join  VAF5.deal deal1 on deal1.dealgroup_id = dealgrp1.id

where deal1.institution_id=16742 and deal1.date_updated between '2018-01-01' and '2018-01-31')

where supplier.id=16742

and date_updated between '2018-01-01' and '2018-01-31';

I tried to implement the query in Qlikview script but its not working .

My requirement is

ProductListing - tempDealProductList should acheive the dealer id every period .

Capture3.PNG

Sample model attached.

2 Replies
veerendrakatika
Contributor III
Contributor III

I thing you should put 'SQL' prefix in your Query and reload

SQL select

  distinct dealer.id as dealer,

  supplier.id as supplier,

      dealer.name as dealername,

      supplier.name as suppliername,

      Month(date_updated) as month,

  Year(date_updated) as year

from VAF5.aux_institutionfspconfig ifspc

inner join VAF5.institution dealer on dealer.id = ifspc.institution2_id

inner join VAF5.institution supplier on supplier.id = ifspc.institution1_id

left join VAF5.deal deal on deal.institution_id = ifspc.institution1_id

#and  deal.dealgroup_id  in (select dealgrp.id from VAF5.dealgroup dealgrp)

and dealer.id  not in (select distinct dealgrp1.institution_id from VAF5.dealgroup dealgrp1 inner join  VAF5.deal deal1 on deal1.dealgroup_id = dealgrp1.id

where deal1.institution_id=16742 and deal1.date_updated between '2018-01-01' and '2018-01-31')

where supplier.id=16742

and date_updated between '2018-01-01' and '2018-01-31';

ashmitp869
Creator II
Creator II
Author

Yes , I understand that but the problem is the deal table does not store history . I have to get the history from qvd and then concatenate it with live data.

So,I cannot directly query sql. Thus , I need to do it in qlikview script with the temp_table_deal from qvd.