Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have the data with the below columns as shown in attached file.
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO,LASTDATE,GETDATE
I want to show the Salary of the employees in a straight table based on JOB on Quarterwise (Q1,Q2,Q3,Q4 based on GETDATE).
Please help me.
When I select:
Q1 >>> Should display Q1 Salary of the year,
Q2 >>> Should display Q1,Q2 Salary of the year,
Q3 >>> Should display Q1,Q2,Q3 Salary of the year,
Q4 >>> Should display Q1,Q2,Q3,Q4 Salary of the year,
Thanks in advance.
Hi,
Try like this
EMP:
LOAD
EMPNO,
ENAME,
JOB,
MGR,
date(HIREDATE,'DD-MMM-YYYY') as HIREDATE,
SAL,
COMM,
DEPTNO,
LASTDATE,
Date(GETDATE, 'DD-MMM-YYYY') as GETDATE,
Year(GETDATE) as Year,
month(GETDATE) as Month,
num(Month(GETDATE)) as MonthNo,
Ceil(month(GETDATE)/3) as QtrNo,
'Q'& Ceil(month(GETDATE)/3) as Quarter,
if(GETDATE > LASTDATE, MGR, ENAME) As [Emp - Current]
FROM
EMP.qvd
(qvd);
Remove all the remaining script.
Now Create a variable
vStartDate = Date(YearStart(Max(GETDATE)), 'DD-MMM-YYYY')
vMaxDate = Date(Max(GETDATE), 'DD-MMM-YYYY')
Now in set analysis use this expression
=Sum({<Year=, Month=, Quarter=, GETDATE={'>=$(=vStartDate)<=$(=vMaxDate)'}>} SAL)
Hope this helps you.
Regards,
Jagan.
Hi,
You can use below code to populate Qtr and then use this qtr in your expression and filters.
LOAD EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO,
LASTDATE,
date(GETDATE) as GETDATE,
Year((GETDATE)) as [Year],
Month(GETDATE) as [Month],
Date(GETDATE, 'YYYY-MM') as [Year - Month],
'Q' & Ceil(Month(GETDATE) / 3) as [Quarter]
P.S. - change your date format in text file as YYYY/MM/DD.
Thanks
BKC
Hi balkumarchandel,
Thank you for the script.I loaded successfully.
As shown in pic, If I select Q2, SHould show Q1 and Q2 as well.
Could you send me expression?
Hi
Attached herewith sample data.
Hope it helps
Thanks
Mohit
Hi,
Refer the attached application.
Thanks
can you share your sample application as in text file date format is not correct.
Hi balkumarchandel,
Please find the attached file.
AnkitaAg, ER.Mohit: ! Thank you for the sample files. But it is not I am looking for.
Hi ,
you need to load a data island for selection column .
See attached qvw, Hope it will help you
Thank you balkumarchandel chandel
ur welcome