Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I'm working on a dashboard with huge data
I have to calculate the man-days
is there a difference between the below syntax?
{<condition_1>-(<condition2>+<condition3>)}
sum(mandays)
and
{<condition_1>}
sum(mandays)
-
{<condition2>}
sum(mandays)
-
{<condition3>}
sum(Mandays)
Try to use seperate sum expression
Sum({<ProjectType={'Active'}>} mandays)
-
Sum({<ProjectType={'Cancelled'}>} mandays)
-
Sum({<ProjectType={'OnHold'}>} mandays)
Depending on the data-set + data-model and the conditions both approaches may return the same results but they are logically quite different because in the first approach the conditions are connected with each other and in the second one not.
Beside this should the first approach be much better performing because it's a single aggregation against a certain selection state and the second one are 3 aggregations against a certain selection state and then on top evaluated. By a larger data-set the differences should be noticeable.
in my case the two approaches are giving different results
so trying to get an explanation of why the results are different
ok it all depends on the data model and data but really I wasn't able to explain the difference
At least - if condition2 and condition3 are both TRUE they will be in the first approach considered only once and the second one considered them twice - and depending on the real data-model/set there may more dependencies.
I think it would be helpful to reduce the data-set with some selections to a small sub-set of a few dozens rows - which return different results between both approaches and then adding more granular dimensions within the chart and/or using an extra table-box with appropriate granular dimensions to look on the relations between the field-values and which one are TRUE or FALSE.
If this manual detection is too complex it could be simplified by adding n extra expressions to the chart which didn't sum/count the fields else used to show the results of the conditions, like:
-(F1='x')
-(F2='y')
-(F3='z')
and a next step may range-sum/count these condition results. With more efforts - using exponential returns for the conditions - an unique condition-evaluation would be possible.
Hello
I adjusted the conditions and now the 2 approaches give the same result
However, with the first approach the result is not related to any dimension so whichever dimension I add to the pivot table that dimension will be null whereas with the second approach the result is distributed on any dimension I add to the table
Kindly advise why
I want to use the first approach because the second one is extremely slow
It hints for a not suitable designed data-model. The object-dimension + the fields within the conditions and aggregations seems to be not sufficient related. If this is the case it needs to be fixed there and not to be bypassed within the UI.