Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
can I link two fields values in the layout?
ex:
I have week and week2, some values are linked with week and others with week2 I need to get the values of week2 but the dimension has to be week,
I've tried to do it in the script calling both fields week but when I load a message of circular fields appears (I don't know why the model is too complex),
any idea?
Thanks,
David
Hello David,
It shouldn't be a problem of formats if they are really the same, you can check that easily using the following in a text object, selecting one value in each field:
If(week2 = week, 'True', 'False')
That will show quickly if they are formatted alike.
Hope that helps.
Hello David,
As I understand, you have two different fields with week values (week and week2) and you want to use something to link them so the user selects "43" and both week and week2 take value "43". If that's correct, check this file that uses variables in sliders or calendars, and using set analysis in the charts, both fields can take that value.
Hope that helps.
Miguel Angel,
I can't check the file you have sent by now and I don't know if it could solve my problem, but my problem is not exactly what you said,
if the field selected is week I know how to use link it with the values of week2 (using something like {<week={week2}>}). The problem is if the user selects another dimension that includes week (ex: month).
Thanks,
David
Hi David,
If you have a master calendar, the field the user is selecting should affect to the conditions in your expressions, meaning that week 01-2010 is in month january, and viceversa, if user selects january, then it will take the first 4 or 5 weeks of the year.
Apart from that, if that's an issue, there are several workarounds, from just not showing the field Month (because the charts are displayed in weeks) to forice the set analysis to ignore the selection done in Month:
Sum({< Week = P(Week2), Month = >} Amount)
Hope that helps.
Hi Miguel Ángel,
I don't want to ignore the field month as I need it to filter the field week,
My problem is I don't know how to link week and week2, if I use:
sum({<week2={week}>} amount) it takes the correct value but only if I make a selection in the field week,
it's useless selecting only a month,
Thanks!
Hi,
That's what's P() function for in set analysis:
Sum({< week2 = P(week) >} amount)
Its' read "sum the values of "amount" where "week2" has all possible values of "week". If you select one value in week, then week2 will sum taking that value. If you don't select anything, wee2 will take all possible values of "week". If you select 3, those three... and so on.
Hope that helps.
Hi Miguel Ángel,
I don't know why but it doesn't work, I've used the P() function in other models and it worked perfectly.
Could it be a format issue? (both dates uses the same format so I'm not sure if I have to force it :S)
Thanks,
David
Hello David,
It shouldn't be a problem of formats if they are really the same, you can check that easily using the following in a text object, selecting one value in each field:
If(week2 = week, 'True', 'False')
That will show quickly if they are formatted alike.
Hope that helps.
Hi,
That was the problem.
At first view week and week2 seems to have same format but your formula returns false... I have to force them with date#,
Thanks Miguel Ángel!