Page 1 of 1

Assign the value to an element according to the picklist value.

Posted: Tue May 17, 2016 11:07 pm
by Prajan_cyber
Please help,New to TM1

cube 'salaryassump' has below dimensions

Grade Salary
--------------------
Grade1 2000
Grade2 3000

Cube Salarycal

Have a dimension element called "grade" with picklist static:grade1,grade2,grade3 and another dimension element is salary.
When grade1 is selected from the picklist ,would like to populate salary with 2000 from salaryassump cube.

Getting an error message.

skipcheck;

['Salary'] = N:
if (attrs('payroll',!grade,'picklist') @= 'Grade1',
DB('SalaryAssump','Grade1','Salary'));

Thanks in advance.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 5:24 am
by Wim Gielis
skipcheck;

['Salary']= N:
DB('SalaryAssump',DB('Salarycal',!payroll,'grade'),'Salary');

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 1:29 pm
by Prajan_cyber
Thanks Wim for your reply.

Now the error has gone .But salary value is not populating,it just shows as '0'.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 1:38 pm
by Wim Gielis
Prajan_cyber wrote:Thanks Wim for your reply.

Now the error has gone .But salary value is not populating,it just shows as '0'.
Hello,

To solve that, we have the "Trace calculation" option in the cube viewer.
Also, pay attention to feeders, if applicable.

Wim

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 2:16 pm
by tomok
Prajan_cyber wrote:Thanks Wim for your reply.

Now the error has gone .But salary value is not populating,it just shows as '0'.
Assuming the code you posted was an "approximation" of the actual code, it's almost impossible to help someone resolve their problems without full disclosure. If you can post the complete dimensionality of both cubes and the actual code that you've written it should be easy to fix.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 3:09 pm
by Prajan_cyber
Cube 'salaryassump' has below dimensions

Grade Salary
--------------------
Grade1 2000
Grade2 3000

Cube Salarycal has below dimensions

Department
Payroll : Headcount ,Salary,Benefits,Bonus,401k,Grade
Year

In payroll 6 elements ,and one of the element is Grade and has a picklist :static:grade1:grade2
When I select grade1 the salary should get the value from the 'salaryassump' cube as '2000' and populate into the cube.

Please let me know how to achieve this.

I am doing this as a learning exercise

Any help will be appreciated.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 4:01 pm
by ardi
If I understant it correctly, your Payroll Dimension is your Measures dimension ( correct? ). Normally Measures dimension is the last dimension in the cube.

But my other problem with that cube design, it looks like you can have only One Grade for One Department / Year combination. Maybe this is what you want, so in that case, the Rule Wim wrote should give you the result but you need to feed that cell or remove the SKIPCHECK if this is such a dense cube with only 3 dimensions

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 5:26 pm
by tomok
Please post a screenshot from Server Explorer of each cube, expanded. By this I mean clicking the plus sign next to each cube so we can see the dimension names and in what order they appear in the cubes.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 6:36 pm
by Prajan_cyber
changed the dimensions to 2 to make it easier,sorry unable to paste the screenshot.

Cube SalaryAssumptions same order as server explorer

Grades : Grade1,Grade2,Grade3
Salary : 2000,3000,4000

Cube SalaryCal same order as server explorer

Year
Payroll: Headcount,Salary,Benefits,Bonus,401k,Grade,Dept

Grade has a picklist value like Grade1,Grade2,Grade3
When I pick Grade1 the salary cell has to populate as 2000 , the value from the Salaryassumptions cube.That's all.

Trying to learn TM1.

Thanks in advance.

Re: Assign the value to an element according to the picklist value.

Posted: Wed May 18, 2016 6:45 pm
by Wim Gielis
What are the dimensions of the Salaryassumptions cube ?
I hope you don't have a dimension where you have the salary amounts as elements...