Hi,
I´ve got an App, which shows several Projects in a Gallery. The Projects are saved in a SQL-Table.
The Budget is sortet alphabetical and not by value. I set Budget as Value(Budget) but it wont sort it right. Did somebody got an Idea?
Sort(
Source_with_filters_and_stuff;
Switch(
DrpSort.SelectedText.Value;
[...];
"Budget";
Value(Budget);
[...]
)
)
Solved! Go to Solution.
Hi @Fricki97 ,
I can't recreate the issue here (it just works) but I might have a quick fix:
Sort(
Source_with_filters_and_stuff;
Switch(
DrpSort.SelectedText.Value;
[...];
"Budget";
Text(Budget;"000000000");
[...]
)
)
This should pad you Budget values with leading zeros, it will still sort alphabetically but because of the zeros it will look like it's sorted on Value. If you have Budgets of over 100 million, just add some zeros to the formula ...
Hope this helps,
Marc
Hi @Fricki97 ,
I notice in the screenshot that the budget sum is preceded by "Budet :", could there be a spelling mistake in the original column name?
Marc
Its just a Mistake in the Label, not in the Data but thanks for the Info.
Hi @Fricki97 ,
Normally, if the column is of the Valuta type and you don't use Value(), the sort is ok.
Sort(
Source_with_filters_and_stuff;
Switch(
DrpSort.SelectedText.Value;
[...];
"Budget";
Budget;
[...]
)
)
Is there a reason you use Value?
Marc
I already tried but it´s the same result 😞
Could you post the complete sort formula? (without the [...])
Sort(
If(
IsBlank(TxtSearch);
Filter(
vP_Projects_for_SWOT;
Mail = User().Email
);
Search(
Filter(
vP_Projects_for_SWOT;
Mail = User().Email
);
TxtSearch.Text;
"projectname";
"projectnumber";
"customernumber"
)
);
Switch(
DrpSort.SelectedText.Value;
"Name";
projectname;
"Projektnummer";
projectnumber;
"Kundennummer";
customernumber;
"Budget";
Budget;
"Kostenstelle";
costcenter;
"Start";
startingdate;
"Ende";
endingdate
);
If(
DESC;
Descending;
Ascending
)
)
Hi @Fricki97 ,
Thank you. I think the "Budget" option might be skipped. Could you try the following code to check this? I set the Budget sort as Default, so you don't have to select an item in the dropdown, this is just for testing:
Sort(
If(
IsBlank(TxtSearch);
Filter(
vP_Projects_for_SWOT;
Mail = User().Email
);
Search(
Filter(
vP_Projects_for_SWOT;
Mail = User().Email
);
TxtSearch.Text;
"projectname";
"projectnumber";
"customernumber"
)
);
Switch(
DrpSort.SelectedText.Value;
"Name";
projectname;
"Projektnummer";
projectnumber;
"Kundennummer";
customernumber;
"Kostenstelle";
costcenter;
"Start";
startingdate;
"Ende";
endingdate;
Budget
);
If(
DESC;
Descending;
Ascending
)
)
forgot to explain: your gallery should be sorted by Budget as a result
It is sorted by budget but still alphabetical