Bonjour tout le monde
je travaille sous SpagoBI server, j'ai besoin de calculer la différence entre deux dates, Ma base de données est sous sql server , j'ai utilisé la fonction
DATEDIFF mais ça marche pas.
Comment je peux faire pour avoir le nombre de jours entre deux dates sous SpagoBi server?
j'utilise 3 paramètres: date depart, date fin et le produit.
quand j'ajoute les 2 paramètres dates sous SpagoBi server, j'ai les types suivant:
-Generic
-String
-Number
-Raw
quel type je vais utiliser?
voici Dataset:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 select DATEDIFF ( day , $P{date} , $P{dd} )/sum(Coef_Rot) as value from Fact_Rotation_Stock where produit_id=$P{produit_id} having sum(Coef_Rot) >'0'
voici la template du Chart:
Merci d'avance pour votre aide,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DIALCHART type="bullet" name="La Durée de Rotation"> <DIMENSION width='400' height='70' /> <STYLE_TITLE font="ARIAL" size="10" color="#ff0000" orientation="HORIZONTAL" /> <STYLE_TICK_LABELS font="ARIAL" size="10" color="#ff0000" /> <STYLE_SUBTITLE font="ARIAL" size="10" color="#ff0000" orientation="HORIZONTAL" name="duree ($P{date}, $P{dd}) et Produit est $P{produit_id}" /> <STYLE_LABELS_DEFAULT font="ARIAL" size="10" color="#ff0000" orientation="HORIZONTAL" /> <CONF> <PARAMETER name="upper" value="300.0" /> <PARAMETER name="lower" value="0.0" /> <PARAMETER name="legend" value="true" /> <PARAMETER name="increment" value="10.0" /> <PARAMETER name="orientation" value="vertical" /> <PARAMETER name="minortickcount" value="10.0" /> </CONF> <INTERVALS> <INTERVAL min='0.0' max='30.0' color='#FF3333'/> <INTERVAL min='30.0' max='70.0' color='#FFCC00'/> <INTERVAL min='70.0' max='100.0' color='#66FF00'/> <INTERVAL min='100.0' max='300.0' color='#1E90FF'/> </INTERVALS> </DIALCHART>
Partager