AnsweredAssumed Answered

Order months result in script (for fiscal year)

Question asked by royercas on Mar 5, 2018
Latest reply on Mar 6, 2018 by beverly

I got this script (Part of...). It's meant to get a "Months list" to use in a Chart but, it is or should be based on a fiscal year period (3 last months of 2017 and 9 months of 2018), So, Should be October, November, December, January, February, ... August, September,

The problem is I'm getting the result in a logical order I think: January (2018), February (2018) ... September (2018), October (2017), November (2017), December (2017)

This is the part of the script:

 

Let (

[

year = Invoices::Year ;

decimal = Left ( Evaluate ( 1/2 ) ; 1 ) ;

SQL = ExecuteSQL (

"

SELECT a.\"Month\", a.\"Month Name\", SUM(a.\"Total_Consolidado\")

FROM \"Invoices\" a

WHERE a.\"Year\" = ?

GROUP BY a.\"Month\", a.\"Month Name\"

"

; "|" ; ¶ ;

year

)

] ;

Substitute ( SQL ; "." ; decimal )

)

 

How could I manage to get the month list sorted by Date or Year, so it shows properly in a chart?

If possible to show me how to implement it in the above script, would be just great!

 

Thanks in advance!!!

Attachments

Outcomes