Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an app where the user chooses an machine and a year from an filter pane and i show him different performance values.
i have one diagram where i show him the data per calendar week and one where the whole year is summarised.
Now i want to add another diagram where i show him the summarised values for the last year.
What i did was to create an alternate state and that would work fine. Problem is usability.
Is there a way to programmatically change the values in the alternate state when the values change in the default state?
Or is there another way simpler solution?
Thanks
you dont need alternating states for this, you can use set analysis:
{<... YEAR={$(=only(YEAR)-1)}...>}
Hi thanks, got it.
But now i have another issue.
I did define my Measures, with colours and everything, like this:
(sum(made_pieces)/sum(productive_duration_sec))*3600
But now i need another measure for the previous year:
(sum({<booking_isoyear={$(=booking_isoyear-1)}>}made_pieces)/sum({<booking_isoyear={$(=booking_isoyear-1)}>}productive_duration_sec))*3600
Do i have another option than to define every Measure twice?
You will have to modify all the expressions where you want to show last year value. Better would be you create a variable and use that is all your expression, so next time if you want to change from last year to previous 2 year , you can simply achieve that by modifying the variable. Like this:
vPreviousYear = Year(Max(booking_isoyear))-1
(sum({<booking_isoyear={$(vPreviousYear )}>}made_pieces)/sum({<booking_isoyear = {$(vPreviousYear)}>}productive_duration_sec))*3600
Hi,
thanks for your answer. I made it as you said and everything is working fine. However, i do not really like this solution as i have to define the same Measure twice.
I do still think working with alternate states would be the cleanest solution, if it would be possible to trigger an change somehow.
I keep it open in the meantime, maybe someone else comes up with a different solution.
Best Regards
if you want to use alt states, you can specify the state when you are adding your triggers. you first define your alt state in doc settings, then in field triggers: