Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Folks,
I have the following set analysis expression on my Dashboard:
= 'Caixa Inicial: ' & Money(Sum({1<Tipo={'Caixa'},DateID={"<$(=vInicioPeriodo)"}>}[Valor Debito]))
This brings me the right value and by using the variable vInicioPeriodo I can do the calculations considering the dimension Month. If no month is selected, vInicioPeriodo = today, if the user select a month on filter vInicioPeriodo = last day of selected month.
This is working pretty well.
I want to do now is to consider my Company dimension. I mean, by default the expression must consider the values from all companies. If the user select one or more companies on the application filter, my expression must consider only values from these companies.
Any idea of how to do that ?
Thanks!
Check the result of the expression in the dollar sign expansion in a textbox:
=GetFieldSelections(Company)
There are some additional arguments for GetFieldSelections functions, e.g. when coping with a lot of Companies.
It's quite hard to tell what's going wrong without knowing much about your data and setting, so it is in general very helpful if you could post a small sample app.
And please add to any sample your requested results when performing some user actions, there are subtle differences in expressions to handle when e.g. asking for results when user explicitely selects values in Company field vs. possible values in Company field.
I've attached a small sample that might show you how you can use GetFieldSelections and GetSelectedCount when requiring an active selection in a field.
Maybe like this:
= 'Caixa Inicial: ' & Money(Sum({1<Company = {$(=GetFieldSelections(Company))}, Tipo={'Caixa'},DateID={"<$(=vInicioPeriodo)"}>}[Valor Debito]))
Getting this error:
Error: Error in set modifier ad hoc element list: ',' or ')' expected
Check the result of the expression in the dollar sign expansion in a textbox:
=GetFieldSelections(Company)
There are some additional arguments for GetFieldSelections functions, e.g. when coping with a lot of Companies.
It's quite hard to tell what's going wrong without knowing much about your data and setting, so it is in general very helpful if you could post a small sample app.
And please add to any sample your requested results when performing some user actions, there are subtle differences in expressions to handle when e.g. asking for results when user explicitely selects values in Company field vs. possible values in Company field.
I've attached a small sample that might show you how you can use GetFieldSelections and GetSelectedCount when requiring an active selection in a field.
Just solved it by using the following expression:
Money(sum({1<Tipo={'Caixa'}, DateID={"<$(=vInicioPeriodo)"}, Filial = {'$(=GetFieldSelections(Filial))'}>} [Valor Debito]))
Thanks swuehl! You gave me the clue!