Hi All,
I have the following situation:
Screen1 - Total Values, selected based on 3 combobox for year, month and total group, with the following commands:
S1_Year_Combobox:
Items: SortByColumns(Distinct(IndicMensal;Year);"Result";Descending)
DefaultSelectedItems: LastN(Distinct(IndicMensal;Year).Result)
S1_Month_Combobox:
Items: SortByColumns(Filter(IndicMensal;Year=S1_Year_Combobox.Selected.Result);Month;Descending).Month
DefaultSelectedItems: LastN(Filter(IndicMensal;Year=S1_Year_Combobox.Selected.Result).Month)
S1_Group_Combobox:
Items: ["Segment";"Category";"Local";"Profile"]
DefaultSelectedItems: ["Segment"]
From this screen, users can go to Screen 2/Details in two different ways: selecting a specific total group line, after selecting Year/Month/Group from Combobox or from a Buttom, that also goes to Screen 2.
In screen 2, there will be again the same 3 Comboboxes, which I would like to be pre-populated with selection from screen 1 (if comes from total group line) or empty if it comes from the Buttom.
In the Gallery for total group lines, I have included a variable to inform screen 2 how it cames from screen1:
OnSelect: Navigate(Screen2; ScreenTransition.Cover;{S1Way: "Line"; S1Year: S1_Year_Combobox.Selected.Result; ; S1Month: S1_Month_Combobox.Selected.Month; S1Group: S1_Group_Combobox.Selected.Value})
On the comboboxes screen 2 included the follwing commands:
S2_Year_Combobox:
Items: SortByColumns(Distinct(IndicMensal;Year);"Result";Descending)
DefaultSelectedItems: If(S1Way="Line";FirstN(Filter(IndicMensal;Year=S1Year).Year);LastN(Distinct(IndicMensal;Year).Result))
S2_Month_Combobox:
Items: SortByColumns(Filter(IndicMensal;Year=S2_Year_Combobox.Selected.Result);Month;Descending).Month
DefaultSelectedItems: If(S1Way="Line";FirstN(Filter(IndicMensal;Year=S1Year && Month=S1Month).Month);LastN(Filter(IndicMensal;Year=S2_Year_Combobox.Selected.Result).Month)
S2_Group_Combobox:
Items: ["Segment";"Category";"Local";"Profile"]
DefaultSelectedItems: If(S1Way="Line";S1Group;"Segment")
I'm having two problems:
1 - I can't find the way to set DefaultSelectedItems for S2_Group_Combobox
2 - Year and Month from screen 2 do not come as DefaulSelectedItems for comboboxes screen2
I would appreciate any help on solving theses issues.
Regards, Marco.

Report
All responses (
Answers (