on 03-06-2014 12:13 PM
Hi Frzz,
Am trying to create a calulation view with two tables. After joining two tables i want the data in below format could you please guide me how to achieve this.
I tried doing it by creating calulated columns of different Status and performed join at each level. But it degrades the performance. Is there is any other way that i can ahieve this??
Table1:
EmployeeID | Name |
---|---|
EMP001 | Ram |
EMP002 | Raj |
EMP002 | Rahul |
Table2:
EmployeeID | Status |
---|---|
EMP001 | Temporary |
EMP002 | Contract |
EMP003 | Permanent |
Result:
EmployeeID | EmployeeName | Temporary | Contract | Permanent |
---|---|---|---|---|
EMP001 | Ram | YES | NULL | NULL |
EMP002 | Raj | NULL | YES | NULL |
EMP003 | Rahul | NULL | NULL | YES |
Best Regards,
Krishna.
Hi Krishna,
Even I have the same requirement in my project.
I tried in this way .
I took three projections and in each project I have created a calculated column with data type as interger and used if condition as below.
projection 1
if("STATUS" = 'Temporary', 1,0)
Projection2:
if("STATUS" = 'contract', 1,0)
Projection3:
if("STATUS" = 'Temporary', 1,0)
and then I used union
finally in sematics I took aggregation as sum for all these calculated colum values.
the output is as below.
.
did you get any other way to resolve it. please share.
see the structure as an attachement to this
Hope this resolves your issue.
Thankyou
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
If there are no measures then you can achieve the same in Attribute view.
In the data foundation get the two tables and join them based on your data(referential join as per your example) and create 3 calculated columns:
Temporary with expression if("STATUS" = 'Temporary', 'YES', 'NULL')
Contract with expression if("STATUS" = 'Contract', 'YES', 'NULL')
Permanent with expression if("STATUS" = 'Permanent', 'YES', 'NULL')
Do the activation and observe the output.
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krisha, not sure what you mean by "performed join at each level" on the calculated columsn.
You should be able to simply create 3 calculated columns with expression like this for column "Temporary":
if("STATUS" = 'Temporary', 'YES', 'NULL')
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.