Skip to main content

Posts

Showing posts from 2025

Adding Primary key

Dropping existing Primary key   ALTER TABLE  [TABLE1] DROP CONSTRAINT [ pkPartIdPartRevTestCode ] Creating New Primary key ALTER TABLE   [TABLE1] ADD CONSTRAINT pkPartIdTestIdSupplierCode PRIMARY KEY (PartId, TestCodeId, SupplierCode);

To extract distinct part numbers from an Excel sheet using an SSIS package

  🛠 Steps in SSIS to Get Distinct Part Numbers from Excel Add an Excel Source : In your Data Flow Task, drag an Excel Source . Configure it to point to your Excel file. Select the sheet or named range that contains the part numbers. Add a Sort Transformation : Drag a Sort Transformation into the Data Flow. Connect the Excel Source to the Sort. In the Sort editor: Check the box for the Part Number column. Check Remove rows with duplicate sort values — this will give you distinct part numbers. Add a Destination : Drag a destination (e.g., Flat File Destination , OLE DB Destination , etc.). Connect the Sort output to the destination. Configure the destination to store the distinct part numbers. Run the Package : Execute the package to extract and store the distinct part numbers.

Data Warehouse vs Data Lake vs Data Lakehouse

  Link to the video :  https://www.youtube.com/watch?v=yRerKDM1h74

Create Summarize table

Problem In this scenario, the requirement is to create a table based on the following fields: Part Number Lemon Score Lemon Score Category Month-Year Here, both Lemon Score and Lemon Score Category are measures , not columns. Solution Since measures return scalar values and cannot be directly used for grouping or categorization in a table, we need to create a summarized table that includes the necessary dimensions and calculated measures. This can be achieved using the SUMMARIZECOLUMNS function in DAX. Here’s how you can create the summarized table: DAX SummarizeTable = SUMMARIZECOLUMNS ( 'Part Daily Details' [ Part Number ] , CalendarTable [ Month - Year ] , "Lemon Score" , [ Lemon Score ] , "Category" , [ Lemon Score Category ] ) Show more l This DAX expression creates a new table that includes: Each unique Part Number Corresponding Month-Year from the calendar table The calculated Lemon Score measure The derived Lemo...

Multi factor investment strategy

 Based on the analysis of multi-factor investment strategies over the long term, the factor combination that yielded the highest return was Momentum and Quality . This finding is based on an analysis of 20-year SIP returns (Systematic Investment Plans), assuming a 50:50 allocation split between the two factor indices. The top performing factor combinations were: Nifty 500 Momentum 50 + Quality 50: This combination delivered the highest annualised return of 18.9 per cent . Momentum + Low Volatility: This was the second-highest performer, returning 18.7 per cent annually. Value 50 + Alpha 50: This combination followed closely, returning 18.6 per cent annually. These multi-factor strategies aim to smooth out the investment journey and improve long-term performance by combining complementary factors. It is also noted that the combination of Nifty 500 Low Volatility 50 + Nifty 500 Momentum 50 and the combination of Nifty 500 Momentum 50 + Nifty 500 Quality 50 delivered ...

Emergency Fund Planning

 Excellent — let’s plan this like a top-tier financial planner would. 🧮 Step 1: Determine Ideal Emergency Fund Size Your monthly expense = ₹30,000 . Emergency fund is meant to cover living expenses when income stops (job loss, illness, etc.). Recommended range: Risk Level Duration Fund Amount Minimal dependents, stable job 3 months ₹90,000 Moderate dependents, average job stability 6 months ₹1,80,000 High dependents / uncertain income / self-employed 9–12 months ₹2,70,000 – ₹3,60,000 ✅ Ideal for most people: 6 months = ₹1.8 lakh. If you have dependents or irregular income, build toward ₹3 lakh . 🏦 Step 2: Where to Keep Your Emergency Fund The key principles: 100% Liquidity (instant access) Capital protection Reasonable return (better than savings a/c) We split it across 3 buckets for safety + liquidity: 1️⃣ Instant Access (30% = ₹54,000) Purpose: For true emergencies — medical, job loss, etc. Where: High-interest Savings A...

How to value Stocks

  Link to the video :  https://www.youtube.com/watch?v=hfsgVrKedJM

Remove Filters on drill through Page

Step-1      Create a Remove filter button as shown below Step-2     Create a bookmark to clear filter and update the bookmark with all the data in that page. Step-3     Tag that bookmark to the created button as shown below. Step-4     Now, after the drill through is applied, you can go the page and click      on remove filters to remove the drill through filter and show all the data.

Filter pane in bookmarks

       Once Slicer is selected and Close button is clicked, Then the filter is not reflect Since we need to make some changes in the bookmark as shown below Step-1     Click on the bookmark which is pointing for Close Button. Step-2     Uncheck the data as shown below

Power BI One Slicer to filter other slicers based on Items that has value only without BI Direction

Ref Video :   https://www.youtube.com/watch?v=cyOquvfhzNM https://www.youtube.com/watch?v=MeLaZFst02E Step-1      Create a measure like below. Cascading=     COALESCE ( DISTINCTCOUNT ( 'table' [ID] ), 0 ) Step-2      Put the created measure in this in this visual section of slicer pane as shown below Step-3     Now in the filter slicer only the relevant data related to the another selected slicer will only appear.

Python code to compare Blog files vs filesnames in sql server

  import pandas as pd from azure.storage.blob import BlobServiceClient import pyodbc # ------------------ Azure Blob Storage Configuration ------------------ blob_connection_string = 'COnncetionstring' blob_container_name = 'Blobcontainer Name' # Connect to Blob Storage blob_service_client = BlobServiceClient.from_connection_string(blob_connection_string) container_client = blob_service_client.get_container_client(blob_container_name) # Fetch file names from Blob Storage blob_file_names = [blob.name for blob in container_client.list_blobs()] df_blob_files = pd.DataFrame(blob_file_names, columns =[ 'FileName' ]) # ------------------ Azure SQL Database Configuration ------------------ sql_server = 'Server Name' sql_database = 'Databse' sql_username = 'user name' sql_password = 'password' sql_driver = 'ODBC Driver 17 for SQL Server' sql_table = 'FileName table' # Connect to SQL Server and fetch file names sql_conn_str...

New Card Visual in Power BI

 Please look into the below video to view of reference labels and details in new card visual Link to video--- https://www.youtube.com/watch?v=XTLo64sydck Link to download pbix File-- https://github.com/powerbibro/powerbibro/blob/main/PBI%20-%2020240309%20-%20Reference%20Label%20Updates.pbix

AI Tools for Developers

 The video outlines a "SMART" framework for software engineers to leverage AI, and it recommends several tools under each letter of this framework to enhance productivity and skill. Here's a summary of the tools mentioned: S - Study This section focuses on using AI to study and learn effectively. Perplexity : Described as an "AI Sherlock Holmes," this tool investigates multiple sources, connects information, and provides deductive conclusions with proof. It synthesizes information from various sources to give comprehensive answers, unlike traditional search engines where users have to piece together information. It's particularly useful for tasks like building a real-time chat application, explaining pros and cons of technologies (e.g., websockets vs. WebRTC), and recommending libraries. It provides citations and real-time web results, making it more accurate than tools like ChatGPT. NotebookLM : This tool is compared to "Doctor Strange of AI...

Websites to Analyze Intrinsic value of a stock

Video Link -- https://www.youtube.com/watch?v=TqVm4q_XzbM&t=42s Seeking Alpha ( seekingalpha.com ) : Provides essential investment information, including stock movement data, company profiles, profitability metrics (gross profit and Avid margins) for financial health, and capital structure details. Kai emphasizes checking short interest , a "super super important" number, advising to generally avoid stocks with over 2% short interest as it indicates many are betting against the stock. Yahoo Finance ( finance.yahoo.com ) : A "classic" and "powerful tool". Its graph features a strong comparison tool to trend multiple companies over time and show percentage changes. Kai highlights recent insider transactions as crucial, suggesting significant insider selling might signal a potential stock drop. Wallmine.com ( wallmine.com ) : Consolidates most information onto a single page , which Kai finds convenient. It offers quick explanations when hovering over...

Chanage Data source in power Bi with Advance editor

Ref Video :   https://www.youtube.com/watch?v=Fd2tU-qull8 STEP-1 - > Go to power query editor STEP-2 -> click on the table you want to change the data source STEP-3 - > go to advance editor, copy the code in advance editor of the data source which needs to changed as data source STEP-4 -> past this code in the table advance editor which you want to change

Schedule Python script using windows task Scheduler

  To run a Python program automatically using Windows Task Scheduler, follow these steps: Create a Python Script : Ensure you have a Python script (.py file) that you want to run. For example,  example.py . Open Task Scheduler : Press  Win + R  to open the Run dialog. Type  taskschd.msc  and press Enter to open Task Scheduler. Create a Basic Task : In the Task Scheduler window, click on  Create Basic Task  in the Actions pane. Enter a name and description for the task, then click  Next . Set the Trigger : Choose when you want the task to start (e.g., Daily, Weekly, One time). Set the specific details for the trigger (e.g., start date and time), then click  Next . Set the Action : Select  Start a program  and click  Next . Specify the Program to Run : In the  Program/script  field, enter the path to the Python executable. For example,  C:\Python39\python.exe  (adjust the path according to your Python ins...