Results for "Function"
38 / 184 posts
What difference between the DATEPART() and DATENAME() functions?
The difference between the DATEPART() and DATENAME() functions lies in their definitions. DATEPART() returns an integer that represents the specified datep…
How to get first date of given date or month.
Get First date of month: SELECT DATEFROMPARTS(YEAR(GETDATE()), MONTH(GETDATE()), 1) AS FirstDayOfCurrentMonth Create function for that IF NOT EXISTS (SELEC…
How to one series with comma separate(any Delimiter) value split into in rows
If we have one series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitSerie…
How to Two series with comma separate(any Delimiter) value split into in rows respectively
If we have two series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitTwoSe…
Window Functions in PySpark
Window functions in PySpark allow you to perform operations across a set of rows that are somehow related to the current row. They are useful for tasks lik…
Window Aggregate Functions in SQL
What is window function: Imagine you have a dataset with many rows, and you want to perform some calculations on each row based on a group of rows related …
Insert <br> tag in SQL text string
CREATE or ALTER FUNCTION dbo.Fn_InserBRtag(@inputString NVARCHAR(MAX)) RETURNS NVARCHAR(MAX) AS BEGIN DECLARE @resultString NVARCHAR(MAX) = ''; DECLARE @st…
All Date Components in SQL
We get First Date , Last date ,month number, month Name,Year, Financial Year(Finyear), and Month Year from Date (Date Range of each single date). SET DATEF…
How to use Window Functions in PySpark
Absolutely! Let’s break it down and explain each PySpark window function with examples using your code and dataset. I’ll categorize the functions into thre…
Spark Transformations, Actions and Lazy Evaluation and DAG.
Apache Spark RDD supports two types of Operations: Transformations Actions A Transformation is a function that produces new RDD from the existing RDDs but …
What is catalog in Spark
In Apache Spark, the catalog refers to the internal management system that keeps track of all the metadata related to tables, databases, functions, and oth…
DateTime in Python
In Python, the datetime module provides classes for manipulating dates and times. It offers several functions and methods to create, manipulate, and format…
Basic Functions in Power BI
SUMX : This function is used to evaluate an expression for each row. It's useful when you need to perform calculations on a row-by-row basis before aggrega…
Advance functions in Power BI
ALL Filter: The ALL filter returns all the rows in a table or all the values in a column, ignoring any filters that might have been applied. This function …
Date Time in Power BI
In Power BI and DAX, the CALENDAR() and CALENDARAUTO() functions are used to generate a table of dates. These functions are particularly useful for creatin…
USERELATIONSHIP function In Power
USERELATIONSHIP: This is particularly useful when you have multiple relationships between the same tables but only one can be active at a time. By default,…
How to Create table in Power BI using Dax
ROW: The ROW function in DAX creates a single row table with the specified columns and values. ROW(columnName1, value1, [columnName2, value2], ...) Si…
Calculate and Calculatetable Function in Power BI
CALCULATE : It's used to modify or filter the context in which a calculation is being performed CALCULATE(<expression>, <filter1>, <filter2&…
ALLSELECTED Function in Power BI
ALLSELECTED : The ALLSELECTED function in DAX is used to return all the rows in a table, or all the values in a column . This is particularly useful in sce…
PartitionBy() in PySpark
partitionBy() एक function है जो DataFrame को disk par likhne (write) के time par use hota hai. ये function pyspark.sql.DataFrameWriter class ka part hai. �…
What is Functions and Difference between Functions and Stored Procedures in SQL Server
What is a Function in sql : A function is a set of SQL Statements that perform a specific task. Basically, it is a set of SQL statements that accept only i…
Functions and Modules in Python
def Grreting(name): print("Hello, " + name + "! Welcome to Python programming.") def main(): user_name = input("Please enter your name: ") Grreting(user_na…
Functions in MySQL
In MySQL, a Function is similar to a Stored Procedure but with some key differences. Functions are used to perform calculations or operations and return a …
Excel formulas
Function What it Counts Syntax Example Range Output Example COUNT Only numeric data =COUNT(range) A1(e.g. 1, "Text", 3, "", 5) =COUNT(A1:A5) → 3 (counts 1,…
Understanding show() in PySpark
In PySpark, the .show() function is used to display DataFrame content in a tabular format. Syntax of show() DataFrame.show(n=20, truncate=True, vertical=Fa…
select() Function in PySpark
In PySpark, select() function is used to select single, multiple, column by index, all columns from the list and the nested columns from a DataFrame, PySpa…
Collect() in PySpark
PySpark collect() Function – The collect() function in PySpark is used to retrieve all the rows of a DataFrame (or RDD) from the distributed cluster back t…
withColumn() in Pyspark
PySpark withColumn() is a transformation function of DataFrame which is used to change the value, convert the datatype of an existing column, create a new …
where() & filter() in PySpark
The filter() function in PySpark is used to create a new DataFrame by selecting rows that meet a specified condition or SQL expression. Alternatively, the …
Groupby in Pyspark
Function Description Example count() Counts the number of rows per group df.groupBy("col").count() mean() Returns the average value per group df.groupBy("c…
drop(), dropDuplicates(), and distinct() in PySpark
🔹 1. drop() – Removing Columns The drop() function is used to remove one or more columns from a DataFrame. 👉 Example: Removing a Single Column from pyspa…
Applying Functions in PySpark
PySpark, the Python API for Apache Spark, provides multiple ways to apply functions to DataFrame columns. This flexibility allows data engineers and analys…
orderBy() and sort() in PySpark
PySpark provides two functions, sort() and orderBy() , to arrange data in a structured manner. 1. Understanding sort() in PySpark from pyspark.sql.function…
PySpark Built-in Functions
These functions are commonly used with groupBy() , agg() , or select() to compute things like sum, average, max, min, count, etc. PySpark functions come fr…
PySpark SQL Date and Timestamp Functions
🔧 Setup First (Optional for Reference) from pyspark.sql import functions as F from pyspark.sql import types as T data = df = spark.createDataFrame(data, )…
PySpark Convert String to Array Column
To convert a string column (StringType) to an array column (ArrayType) in PySpark, you can use the split() function from the pyspark.sql.…
substring() in PySpark
📌 What is substring() ? The substring() function in PySpark is used to extract a portion of a string from a column in a DataFrame. It is part of the PySpa…
What is “CREATE TABLE TYPE” in SQL Server?
Ye ek User-Defined Table Type (UDTT) hota hai. Aap SQL Server me ek custom table ka design bana lete ho, jise aap baad me Stored Procedures, Functions, aur…