#
#		ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquerymfile_SVCLRFSTATEXOFFOSVTtag.txt
#	DESCRIPTION:	DQUERY definitions for DQUERY SVCLRFSTATEXOFFOSVTtag
#
@querytitle 			Anzahl Meldungen mit Clearingfällen per SVT und Tag
@attributenames			formatascsv:noyes:{{formatascsvoptions}}
@formatascsvoptions		{"labeltext":"Als CSV formatieren","typedesc":"Yes, wenn die Ausgabe als CSV formatiert werden soll","is_optional":"true"}
@group					SVCLMVBRFAUSWREPSTAT
@querytype				dbselect
@pre_query
	if (aux.txtObjDecode(that.query.formatascsv)) {
		that.query.format = 'csv';
	}
@sql					select * from svclexoffosvttag where MELDUNGS_DATUM>=20191000
# table svclexoffosvttag is re-created daily by DQUERY LOADMVBRFAUSWMULTI
@post_query
	let ptlres = aux.pivotizeResult(that.result,	{	pivotize:	{	vcolumns:		[ 'MELDUNGS_DATUM' ],
																		hcolumns:		[ 'TRAEGER' ],
																		value_column:	'ANZAHL_EXOFFO_MBGM',
																		vkeyformat:		"CONCAT",
																		hkeyformat:		"CONCAT",
																		vkeycolname:	"DATUM"
																	}
													}
									);
	that.result = ptlres;
@disposition			view