Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to display a graph based on some calculations. Lets say I have a table as below.
Year | EmpID | Val1 | Val2 |
---|---|---|---|
2013 | 1234 | 50 | 60 |
2013 | 2321 | 34 | 56 |
Lets say there are 3 categories Category A and Category B based on conditions like Val1 > x and Val2 <y etc..
I need to put each Employee in the any one of the category, either A or B.
Similar category I need to do it for past 2 years for the same employee. And finally based on A or B in the consequetive 2 years (2013, 2012), I need to assignment employee a color in a graph.
Questions:
1) Where to I write the script? In general edit script page or in the expression space particular to the graph ?
2) Can a value be stored so that when I choose details of different employees, I can still get the results of that particular employee only?
any other suggestions on implementing this function...
Hi
If the categories do not depend on selections made in the front end, then do the categories in the load script. You will need something like this:
Let x = ....;
Let y = ....;
LOAD Year,
EmpId,
Val1,
Val2,
If(Val1 > x And Val2 < y, 'A',
If(......, 'B',
'C')) As Category
From ....;
This is just an example. You will need to adjust this script according to your requirements.
Hope that helps
Jonathan
Thanks, Jonathan.
It worked out with something similar your example.