Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Date Order #97

Open
stei0792 opened this issue Feb 4, 2019 · 1 comment
Open

Reverse Date Order #97

stei0792 opened this issue Feb 4, 2019 · 1 comment

Comments

@stei0792
Copy link

stei0792 commented Feb 4, 2019

Dear Team,

I am in need of some code modification so that my Date column is in reverse order, so most recent dates to past dates. Below is what I tried, however this just shows the two dates first not necessarily this as a range from 2019-01-31 to 2010-01-31. Any solution would really help if you have any time to help.

df is the dataframe

rpivotTable(df, rows=c("ForecastGroup","Date"),
cols=c("Region"), aggregatorName="Sum",
rendererName = "Table", vals="Tons",
sorters=
"function(attr) {
var sortAs = $.pivotUtilities.sortAs;
if (attr == "Date")
{ return sortAs(["2019-01-31", "2010-01-31"]); }
}"
)

Thanks,

@jangorecki
Copy link

If you turn them into factors you can get any custom order you want by defining order of factor levels. Once #106 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants