Working With Pools Procedure Pools 1
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=g7n-MYkcIek
Utilizing Procedure-Type Pools in QuickApp: A Guide to Reading Data from Stored Procedures • Welcome to today’s video, where we delve into utilizing procedure-type pools in QuickApp to enhance our application's data management capabilities. Follow along as we walk through setting up and configuring these pools to dynamically retrieve store count metrics. • In this video, we will cover: • π Overview of Procedure-Type Pools • Learn the advantages of using stored procedures within QuickApp for more complex data retrieval. • π Setting Up the Sales Budget Pool • We’ll begin by loading the Sales Budget workspace and reviewing an existing pool setup that uses direct commands to fetch store count data. • π Transitioning Business Logic to SQL Procedures • Discover how to shift business logic from direct commands to stored procedures, improving flexibility and scalability in your applications. • π Creating and Configuring a New Procedure-Type Pool • Watch as we create a new pool specifically for calling stored procedures, complete with parameters for sales channel, season, and brand. We'll guide you through mapping filters, setting pool keys, and linking pool values seamlessly. • π Testing the New Store Count Metrics • Finally, we’ll validate our work by loading the Last Year Store Count layer to confirm that our new pool delivers accurate metrics. • Stay tuned for our next video, where we’ll explore creating procedure-type pools for writing data back to the database. • Links Resources: • π» Source Code for the Procedure – Check the comments for the SQL code used in today’s demo. • π Previous Videos • For additional insights, revisit our earlier tutorials on direct command pools and the QuickApp platform’s advanced features. • π Don't forget to like, subscribe, and hit the bell icon to stay updated with our latest videos! • #QuickApp #merchandiseplanning #retailindustry #lowcode #lowcodeplatform • /*======================================================== • --BEGIN: spGetStoreCount Source Code • ========================================================*/ • CREATE PROC [actual].[spGetStoreCount]( • @SalesChannelID INT, • @SalesSeasonID INT, • @BrandIDs NVARCHAR(MAX) • ) • AS • SET NOCOUNT ON; • SELECT StoreID • , SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth • , SUM(SLSU) SLSU • INTO #StoreSales • FROM actual.vwSalesLY • WHERE SalesChannelID = @SalesChannelID • AND SalesSeasonID = @SalesSeasonID • AND BrandID IN (SELECT CONVERT(INT,ColumnName) FROM dbo.fnSplit(@BrandIDs,',')) • GROUP BY StoreID • , SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth; • WITH wtStoreRankings AS • ( • SELECT StoreID • , SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth • , SLSU • , CumulativeSalesPct = SUM(SLSU) OVER (PARTITION BY SalesChannelID, SalesSeasonID, BrandID, CategoryID, MainGroupID, ProductGroupID, MerchYear, MerchMonth ORDER BY SLSU DESC) * 1.0 / • SUM(SLSU) OVER (PARTITION BY SalesChannelID, SalesSeasonID, BrandID, CategoryID, MainGroupID, ProductGroupID, MerchYear, MerchMonth) • FROM #StoreSales • GROUP BY StoreID • , SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth • , SLSU • ) • SELECT SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth • , COUNT(1) AS StoreCount • , SUM(CASE • WHEN CumulativeSalesPct lt;= 0.8 THEN 1 --please replace lt; with less than sign • ELSE 0 • END) Top80StoreCount • FROM wtStoreRankings • GROUP BY SalesChannelID • , SalesSeasonID • , BrandID • , CategoryID • , MainGroupID • , ProductGroupID • , MerchYear • , MerchMonth; • GO • /*======================================================== • --END: spGetStoreCount Source Code • ========================================================*/
#############################
