Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have Project_Type and the Projected_Hours for those project types in my data model.
I have a requirement where the user will select n number of projects.
In the below snapshot, I have select 3 TypeA projects. So hours used when a resource is assigned those 3 projects will be 3*2=6 hours. So remaining hours for that resource will be 40-6=34 (Assuming each resource works 40 hours a week).
Similarly, If 2 TypeB project are selected, hours used when a resource is assigned projects will be 2*6=12 hours. So remaining hours for that resource will be 40-12=28
In the above example, I have select 2,3 projects from SAME project types. But the user can select projects from different Project_Types.
In that scenario, what should be the expression? The expression which I have used to calculate Hours Used is (GetSelectedCount([Project Name])*[Projected Hours])
However, this works only when the ProjectType is same. When I select 1 project of TypeA and 3 projects of TypeC, the expression fails.
How should I tweak my expression?
I hope I have made the requirement clear. Any help is appreciated.
Thanks,
YASH
There may be cleaner ways to do this, but since your tables aren't actually joined in any way, I'd use aggr().
sum(total aggr(sum( [Projected Hours])*count(distinct [Project Name]),[Project Type]))
There may be cleaner ways to do this, but since your tables aren't actually joined in any way, I'd use aggr().
sum(total aggr(sum( [Projected Hours])*count(distinct [Project Name]),[Project Type]))
Thanks! this expression worked perfectly.
I have one more question. I also need to give user the ability to enter the number of projects of a particular type
(I'm using slider for user input).
I created 3 variables vTypeA, vTypeB and vTypeC and put there sum in another variable vAll.
However, there seems to be something which I'm missing. I have selected 1 project of each type through slider.
But instead of calculating (2x1)+(6x1)+(10x1), it is calculating (2+6+10)*3
Is there a way to do this via sliders? I have attached the updated app with the variables.
Thanks for your help again. Appreciate a lot!
Yash
Nothing is attached..
I have attached the pp in the question itself.
Unfortunately, it's hard to debug a formula I can't see, so a screen capture doesn't help here.