Skip to main content

Advertisement

Table 2 SQL-functions - scripts

From: Towards decision analytics in product portfolio management

Issue Script
Issue 1 select CONVERT(int,RIGHT((CONVERT(varchar,<article_nr>))),6))
FROM < table_name>
WHERE len(<article_nr>) = 6 and
FA076_OWG = 1
Issue 2 SELECT * from < table_name>
WHERE
FA076_OWG <> < mainproductgroup_nr > and
FA076_OWG <> < mainproductgroup_nr > and
....
FA076_OWG <> < mainproductgroup_nr>
Issue 3 SELECT < productgroup_nr>, DATEPART(YEAR, FA076_LS_DATUM), DATEPART(MONTH,FA076_LS_DATUM), SUM(FA076_KG_MENGE)
FROM < table_name>
WHERE FA076_WG = <productgroup_nr>
GROUP BY productgroup_nr, DATEPART(YEAR, FA076_LS_DATUM), DATEPART(MONTH, FA076_LS_DATUM)
ORDER BY productgroup_nr, DATEPART(YEAR, FA076_LS_DATUM), DATEPART(MONTH, FA076_LS_DATUM)