cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the distinct values in calculation views

Former Member
0 Kudos

Hi

I have an requirement where I need to get the distinct values( employee ids) from a calculation views. The views returns distinct rows but there are duplicate employee id with different other attributes in the view from where I need to extract the distinct ids.

Any help would be highly appreciated.

Regards

Rajib

Accepted Solutions (0)

Answers (3)

Answers (3)

chandan_praharaj
Contributor

You have to either use Projection Node or Aggregation node to see the distinct value, the default projection will show you the raw table data .

Former Member
0 Kudos

This message was moderated.

nithinu
Participant
0 Kudos

Hi Rajib,

The rows will be distinct based on the number of columns you have added in the distinct list, if you need distinct employee ids then just select the employeeid column only. Can you post your query or graphical calc view's image here.

Regards,

Nithin

Former Member
0 Kudos

Dear Nitish

Thanks a lot for you help. Following is the output of the data from one of the CV. I just need to extract the distinct emp ids from this cv.. I need this data in this CV also as this will be used later for each distinct person id.

Employee ID             Attribute Start_date End_date
112143531-Jan-1631-Dec-16
112434341-Jan-1631-Dec-16
121274741-Jan-1631-Dec-16
131636641-Feb-1629-Feb-16
138757571-Feb-1631-Dec-16
1429292920-Jan-1631-May-16

Regards

Rajib

nithinu
Participant
0 Kudos

Hi Rajib,

I am not sure whether you are using a graphical or scripted calculation view to generate this output. For scripted view you may use the following script to generate both these results in a single CV

SELECT EMPLOYEEID,ATTRIBUTE,START_DATE,END_DATE

FROM "schema_name"."EMP_MAS"

GROUP BY GROUPING SETS ((EMPLOYEEID,ATTRIBUTE,START_DATE,END_DATE),(EMPLOYEEID)) .

The output will be

For Graphical views I am not sure any such possible options are available. Or, is it possible for you to create a new CV which only takes the distinct employee id values ?, also you can fire a query which fetches the distinct Employee id against your developed calc view.

Regards,

Nithin

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Rajib,

Use "Projection Node" in Calculation View.

In Projection Node, Select only EMPLOYEE_ID Column,

Then Projection Node Output will only give Distinct Employee_ID's.

Regards,

Muthuram