SELECT employeename AS EmployeeName, CONCAT('₹', SALARY) AS Employee_Salary
FROM employee;
EVALUATE
SELECTCOLUMNS(
employee,
"EmployeeName", employee[employeename],
"Employee_Salary", "₹" & FORMAT(employee[salary], "#,##0")
)
import pandas as pd
# Sample DataFrame
data = {
'employeename': ['John Doe', 'Jane Smith', 'Alice Brown'],
'salary': [70000, 50000, 60000]
}
df = pd.DataFrame(data)
# Prepend '₹' to the salary and rename the columns
df['Employee_Salary'] = '₹' + df['salary'].apply(lambda x: f"{x:,}")
df = df.rename(columns={'employeename': 'EmployeeName'})
# Select the necessary columns
result = df[['EmployeeName', 'Employee_Salary']].values.tolist()
print(result)
| John Doe | ₹70,000 |
| Jane Smith | ₹50,000 |
| Alice Brown | ₹60,000 |
"₹" & FORMAT(employee[salary], "#,##0"): Prepends '₹' to the formatted salary. SELECTCOLUMNS: Creates a new table with columns EmployeeName and Employee_Salary.
Leave a Comment