Monday, January 16, 2023

Create a Donut chart by Sales & Profit over Category --Tableau Intreview Question

 

--Tableau Interview Question  A**ion L**s India Private Limited Tableau Interview Question 
--Create a Donut chart by Sales & Profit over Category 


Follow my Tableau Public Profile

Donurt Chart by Sles & Profit Over category | Tableau Public



When the user will select subcategory , that particular subcategory will colored & level up with sales - Tableau Interview Question

 --Question:-When the user will select subcategory , that particular subcategory will colored & level up with sales 
--Asked by Big 4 Tableau Interview Question 

Follow my Tableau Public Profile Blog: Sub category hover | Tableau Public

Choose the Dimension & Top N by Drop down --Tableau Interview Question

--Choose the Dimension & Top N by Drop down 
--Tableau Interview Question
--Asked by Klou** Interview question

Follow my Tableau Public:
Choose Dimension BY Parameter & Top N | Tableau Public

User can select the moving average day by parameter-Tableau Intreview Question

 Question-User can select the moving average day by parameter

--Tableau Intreview Question

--Asked by Ti**r A**l***cs

Follow my Tableau Public to get the details.
Tableau Public:

https://public.tableau.com/app/profile/arabinda.mohapatra/viz/MovingavergaebysalesInputbyUser/Movingavergaebysales?publish=yes



Drop down list of YOY, MOM,QOQ Growth --Tableau intreview Question

--Question  A**ion L**s India Private Limited Tableau interview Question 

--Drop down list of YOY, MOM,QOQ Growth 

--Vist my Tableau public to get the details

https://public.tableau.com/app/profile/arabinda.mohapatra/viz/DropdownofYOY_MOM_QOQGrowth/GROWTHKPI?publish=yes



How to change the default properties of aggregation from sum to average -Tableau Intreview Question

 --How to change the default properties of aggregation from the sum to average 

Answer-Default properties > Aggregation> SUM (By default) .Can change to maximum, minimum & aggregation 

Sunday, January 8, 2023

Dealing with 20M records in Tableau (CTe,Temptable & Empty extract)

--Tableau Handling Large dataset. 

Dealing with 20M records in Tableau 

  • Create a Temp table to hold the data and to store the intermediate result in INITIAL SQL & load the data to TEMP Table.
  • doo the calculation on the top of that temp table in the Tableau Custom SQL.
  • Create an Empty extract on top of it 
  • Publish the Data source  & refresh on the tableau server level only.


Empty extract

  • Create a Boolean paramter 
  • Create the workbook 
  • Make a calculated field on the top of that parameter
  • Show the parameter and select True
  • Create a extract by adding that calcualted field as exculding the True 
  • You can check the no of records in the workbook is ZERO AND Now you have zero extract ready 
  • Now make the parameter to False so that the the condition will True (True exculde in the Extract filter & Parameter will select False)
  • Now publish the data source on the tableau server.
  • Refersh over the tableau server.
  • We can connect that datasource to get all the data.


How to add the custom color palette in Tableau

 --Asked by Ti*er An**yti*s
--How to add the custom color palette in Tableau 

--Go to the My Tableau Repository and open the preference 
--Edit that html by adding color platte 
<workbook>
<preferences>
<color-palette name="PLAYDATABLOGS" type="regular" >
<color>#f6bc50</color>
<color>#ab3939</color>
<color>#374674</color>
<color>#7ba668</color>
<color>#a08ca3</color>
</color-palette>
</preferences>
</workbook>


How to add custom shape in Tableau

 --How to add the custom shape in Tableau

--Go to  C:\Users\arabi\OneDrive\Documents\My Tableau Repository\Shapes
--Add a folder & paste all the icon (PNG Format only)
--Reload the shape






Saturday, January 7, 2023

Find out the possible pair but the pair should not repeat with respect to the order of the pair

 --SQL Interview question
--Find out the possible pair but the pair should not repeat with respect to the order of the pair 
--Table has 5 rows maximum possible pair is 10







CREATE TABLE COUNTRY (Country_name nvarchar(100))


insert into COUNTRY values ('INDIA'),('US'),('UK'),('Oman'),('Russia')
SELECT REPLICATE ('*',500) As 'INPUT TABLE'
GO
select * from COUNTRY
GO
SELECT REPLICATE ('*',500) As 'OUTPUT TABLE'
go 

WITH COUNTRY_1 AS
(
SELECT ROW_NUMBER () OVER (ORDER BY Country_name DESC ) as'Country_ID',* FROM COUNTRY
)
SELECT CONCAT(C1.Country_name,'-',C2.Country_name) as 'PAIR_NAME' FROM COUNTRY_1  C1 INNER JOIN 
COUNTRY_1 C2 ON C1.Country_ID > C2.Country_ID


Swap the consecutive rows and the first & last rows will remain same (No changes will be on 1st and last row)

---Swap the  consecutive rows and the first & last rows will remain same (No changes will be on 1st and last row)

---SQL INTERVIEW QUESTION


SELECT REPLICATE ('*',500) As 'INPUT TABLE'
SELECT EMPLOYEE_ID FROM [dbo].[EMPLOYEE_DATA]
SELECT REPLICATE ('*',500) As 'OUTPUT TABLE'

SELECT EMPLOYEE_ID ,
CASE WHEN EMPLOYEE_ID  = (SELECT MIN(EMPLOYEE_ID) FROM [dbo].[EMPLOYEE_DATA]) THEN EMPLOYEE_ID
WHEN EMPLOYEE_ID  = (SELECT MAX(EMPLOYEE_ID) FROM [dbo].[EMPLOYEE_DATA]) THEN EMPLOYEE_ID
WHEN employee_id %2!=0  THEN EMPLOYEE_ID-1 --Odd 
WHEN  employee_id %2=0 THEN EMPLOYEE_ID+1 --EVEN  
--ELSE employee_id
END 'SWAP_EMP_ID '
FROM [dbo].[EMPLOYEE_DATA]


Thursday, January 5, 2023

Tableau Interview question asked by BIG 4

 --Tableau Interview question asked by BIG 4

Question-Suppose you clicked on the 2018 Year sales data (Sheet 1) & Filtered Data should populate on another sheet(Sheet 2) containing the 2018 sales data by each month of 2018(Monthly trend sales of 2018) within the same dashboard  . When you deselect the 2018 year sheet(sheet 1) the monthly sales sheet(sheet 2) should disappear from the dashboard. Along with this title should disappear when you de select sheet 1 .but the sheet2 title should appear when I clicked on sheet 1.

--Used sample superstore data
--Tableau Action filter 


Hide the clicked sheet & Filtered Data should populate on the another sheet within same dashboard | Tableau Public

Tableau Interview question asked by BIG 4-Visualization to reflect how sales of each category is performing throughout out the Each quarter

Create a Visualization to reflect how sales of each category is performing throughout out the Each quarter 

Datasource-Sample super store
Published on Tableau public



Category sales on each quater | Tableau Public

Monday, January 2, 2023

L&T SQL Interview Problem | Print Highest and Lowest Salary Employees in Each Department

 ----L&T SQL Interview Problem | Print Highest and Lowest Salary Employees in Each Department---------

---SQL INTERVIEW QUESTION--------


USE [SSIS]
create table employee 
(
emp_name varchar(10),
dep_id int,
salary int
);
delete from employee;
insert into employee values 
('Siva',1,30000),('Ravi',2,40000),('Prasad',1,50000),('Sai',2,20000)
SELECT * FROM employee


---Sample Table Creation--------------------


---Solution------------------------


WITH max_min_salary AS(
SELECT *,max(salary)OVER(PARTITION BY dep_id)AS max_salary,
min(salary)OVER(PARTITION BY dep_id)AS min_salary
FROM employee)

--SELECT * FROM max_min_salary


SELECT dep_id,max(CASE WHEN salary=max_salary THEN emp_name END) AS max_salary_employee,
 max(CASE WHEN salary=min_salary THEN emp_name END) AS min_salary_employee
FROM max_min_salary
GROUP BY dep_id


------------------END OF THE SOLUTION--------------



Maximum no of records by INNER JOIN,LEFT JOIN,RIGHT JOIN & FULL JOIN

 --Maximum no of records by INNER JOIN,LEFT JOIN,RIGHT JOIN & FULL JOIN

--SQL INTREVIEW QUESTION

--Asked by Synchron

----------------------------------------------------------------------------------

USE [SSIS]
Create table Synechron_TABL
(
     ID int ,
     DepartmentName nvarchar(50),
     Location nvarchar(50),
     DepartmentHead nvarchar(50)
)
Go
--DROP TABLE Synechron_TABL
Insert into Synechron_TABL values (1, 'IT', 'London', 'Rick')
Insert into Synechron_TABL values (1, 'Payroll', 'Delhi', 'Ron')
Insert into Synechron_TABL values (1, 'HR', 'New York', 'Christie')
Insert into Synechron_TABL values (1, 'Other Department', 'Sydney', 'Cindrella')
Go
--DROP TABLE Synechron_TABL_2
Create table Synechron_TABL_2
(
     ID int ,
     Name nvarchar(50),
     Gender nvarchar(50),
     Salary int
     
)
Go
Insert into Synechron_TABL_2 values (1, 'Tom', 'Male', 4000)
Insert into Synechron_TABL_2 values (1, 'Pam', 'Female', 3000)
Insert into Synechron_TABL_2 values (1, 'John', 'Male', 3500)
Insert into Synechron_TABL_2 values (1, 'Sam', 'Male', 4500)
Insert into Synechron_TABL_2 values (1, 'Todd', 'Male', 2800)
Insert into Synechron_TABL_2 values (1, 'Ben', 'Male', 7000)
Insert into Synechron_TABL_2 values (1, 'Sara', 'Female', 4800)
Insert into Synechron_TABL_2 values (1, 'Valarie', 'Female', 5500)
Insert into Synechron_TABL_2 values (1, 'James', 'Male', NULL)
Insert into Synechron_TABL_2 values (1, 'Russell', 'Male', NULL)
Insert into Synechron_TABL_2 values (1, 'PINTU', 'Male', NULL)
SELECT * FROM Synechron_TABL_2
SELECT * FROM Synechron_TABL


SELECT  COUNT (*)  as 'INNER JOIN' FROM Synechron_TABL_2 T2
INNER JOIN Synechron_TABL T1
ON T1.ID=T2.ID



SELECT  COUNT (* ) AS 'LEFT_JOIN_COUNT' FROM Synechron_TABL_2 T2
LEFT JOIN Synechron_TABL T1
ON T1.ID=T2.ID


SELECT  COUNT (*) AS 'RIGHT_OUTE_JOIN'   FROM Synechron_TABL_2 T2
RIGHT JOIN Synechron_TABL T1
ON T1.ID=T2.ID


SELECT  COUNT (*) AS 'FULL_OUTER_JOIN'   FROM Synechron_TABL_2 T2
FULL  JOIN Synechron_TABL T1
ON T1.ID=T2.ID





Sunday, January 1, 2023

NOT COMMON RECORDS FROM TWO TABLE

 --NOT COMMON RECORDS FROM TWO TABLE






USE [SSIS]
SELECT REPLICATE('*',100) as 'INPUT_TABLE'
SELECT * FROM [dbo].[emp_2020]
SELECT * FROM [dbo].[emp_2021]



------1ST WAY OF SOLUTION-----


SELECT REPLICATE('*',100) as 'OUTPUT_TABLE'


SELECT * FROM [dbo].[emp_2020] E_20 WHERE E_20.emp_id NOT IN 
(
SELECT E_21.emp_id   FROM [dbo].[emp_2021] E_21 
)
UNION ALL
SELECT * FROM [dbo].[emp_2021] E_20 WHERE E_20.emp_id NOT IN 
(
SELECT E_20.emp_id   FROM [dbo].[emp_2020] E_20
)


----------2ND WAY OF SOLUTION---------------------

SELECT E_20.emp_id,E_21.emp_id FROM [dbo].[emp_2020] E_20
FULL JOIN  [dbo].[emp_2021] E_21 ON E_20.emp_id = E_21.emp_id
WHERE E_20.emp_id IS  NULL OR E_21.emp_id IS  NULL 


"🚀 Delta Lake's Vectorized Delete: The Secret to 10x Faster Data Operations!"

"🚀 Delta Lake's Vectorized Delete: The Secret to 10x Faster Data Operations!" Big news for data engineers! Delta Lake 2.0+ in...