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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
emiliajohannesson1995
Contributor
Contributor

SQL stored procedure to Qlik sense

Hi!

I need some help to figure out the best way to convert a stored procedure to qlik sense. 

Here is an example of the script I need to have in qlik. 

SELECT GPxxxxx.Buyxxxxx,SUM(isnull(GPxxxxx.GrossProzzz,0)) as GrossProzzz

INTO #GP
FROM GPxxxxx WITH(NOLOCK)
INNER JOIN Buyxxxxx WITH(NOLOCK) ON GPxxxxx.Buyxxxxx = BuySell.Buyxxxxx AND GPxxxxx.Source <> 'B' and Exists(SELECT Buyxxxxx FROM WksDyyyyyyy INNER JOIN GLAccount WITH(NOLOCK) ON GLAccount.GLAcct = WksDyyyyyyy.GLAcct WHERE GLAccount.Cat <> 'COMM EXPENSE' AND WksDyyyyyyy.Buyxxxxx = Buysell.Buyxxxxx)
WHERE
(InvoiceDtqqq >= @FromDt and InvoiceDtqqq <= @ToDt)
AND BuySell.[STATUS] = 'I'
AND BuySell.TotalWeightLbs <> 0
AND (@Dept = '' OR Buysell.COIIIID = @Dept )
AND (@TradeType = '' OR Buysell.TradeType = @TradeType )
AND (@SalesRep = '' OR (@SalesRep = BuySell.Referrer222 OR @SalesRep = BuySell.ReferrerNo2))
GROUP BY GPxxxxx.Buyxxxxx

Thanks in advance!

 

Br,

Emilia 

 

 

Labels (1)
0 Replies