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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Function in Script

Hello,

I have to create a QVD with a result of an function SQL:

In Microsoft SQL Server the function is :

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE FUNCTION <Inline_Function_Name, sysname, FunctionName>
(
-- Add the parameters for the function here
<@param1, sysname, @p1> <Data_Type_For_Param1, , int>,
<@param2, sysname, @p2> <Data_Type_For_Param2, , char>
)
RETURNS TABLE
AS
RETURN
(
-- Add the SELECT statement with parameter references here
SELECT 0
)
GO)

How I can create a QVD with this?

Can you help me please?

Kind Regards

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If I understand correctly, you just need to use your SELECT statement in QlikView and use the $ sign expansion functionality to pass any values as parameters. For example:

SQL SELECT * FROM SALES WHERE DATE >= $(MyCalculatedDateVariable)

cheers,

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If I understand correctly, you just need to use your SELECT statement in QlikView and use the $ sign expansion functionality to pass any values as parameters. For example:

SQL SELECT * FROM SALES WHERE DATE >= $(MyCalculatedDateVariable)

cheers,

Not applicable
Author

Thank you very much 🙂