Saturday, 19 April 2025

Finding duplicate values in a SQL Table

 

Finding duplicate values in a SQL Table

Assume you have a table named your_table with a column named your_column where you want to find duplicates.

SELECT your_column, COUNT(*)
FROM your_table
GROUP BY your_column
HAVING COUNT(*) > 1;

If you want to find duplicates based on multiple columns, you can modify the query like this:

SELECT column1, column2, COUNT(*)
FROM your_table
GROUP BY column1, column2
HAVING COUNT(*) > 1;

Thursday, 17 April 2025

SSIS Package troubleshoot


SSIS Package troubleshoot


  • In case if your SSIS package i snot working
  • Backup your DTSX file While will named as pacakage as shown below


  • After that open go to visual studio -> File-> New project
  • on the right pane, Right click on SSIS package-> Click Add Existing package as shown below

  • Right clik on the .dtsx file and click Exceute task as shown below

Saturday, 12 April 2025

Loc and iLoc Properties in Pandas

 

Loc and iLoc Properties in Pandas



# Get the first row value of the column 'Supplierid'
first_supplier_id = df.loc[0, 'Supplierid']




Examples iloc

Example loc











 









Wednesday, 9 April 2025

Python-Pandas

 

Renaming columns using column index


Renaming it using a Column number



Renaming it using a label





Power BI

 

Calculating the part number count by supplierId using DAX measures


  • Calculating the count of partnumber based on supplierid
Part Count by Supplier = 
CALCULATE(
    DISTINCTCOUNT('Spec Data'[PartID]),
    ALLEXCEPT('Spec Data', 'Spec Data'[SupplierID])
)

Step 2: Create the Calculated Column for Part Count Category

Next, create a calculated column to categorize the part counts into the specified ranges.

Part Count Category = 
SWITCH(
    TRUE(),
    [Part Count by Supplier] < 10, "Less than 10",
    [Part Count by Supplier] >= 10 && 'YourTable'[Part Count by Supplier] <= 50, "10 to 50",
    [Part Count by Supplier] > 50 && 'YourTable'[Part Count by Supplier] <= 100, "50 to 100",
    [Part Count by Supplier] > 100, "Greater than 100",
    "Unknown"
)

Output as below