Pivoter une table peut avoir un interêt, notamment pour faire du reporting.
Voici un exemple simple d'utilisation ce cette commande SQL.
Décisionnel
jeudi 22 juillet 2010
Pivoter une table avec Sql Server 2005 >
Par jb le jeudi 22 juillet 2010, 23:08
mardi 29 juin 2010
Macro Excel : Générer les ordres SQL INSERT à partir d'une feuille Excel
Par jb le mardi 29 juin 2010, 16:57
Voici le code d'une macro permettant la génération automatique d'ordres SQL INSERT à partir des données d'une feuille excel.
prérequis :
- La première ligne de données doit contenir le nom des colonnes.
- Le nom de la feuille doit correspondre au nom de la table
Résultat:
La macro génère un fichier .sql portant le nom de la table cible, contenant les ordres SQL du type INSERT INTO mytable(col1,col2,...) VALUES(val1,val2,...).
jeudi 27 mai 2010
Convertir un fichier csv en xls en ligne de commande : mycsv2xls.vbs
Par jb le jeudi 27 mai 2010, 16:01
Suite à un besoin ponctuel d'intégration de données, j'ai développé un petit script en VB, utilisant l'application Excel pour faire l'import automatique de fichiers délimités par des points-virgule dans un fichier Excel.
En effet, une source Excel dans Microsoft SSIS est beaucoup plus facile d'emploi qu'un fichier plat, notamment lorsque le nombre de colonnes dans le fichier n'est pas fixe.
Le Script en question pourra être exécuté dans SSIS par l'utilisation d'un 'Execute Process Task'.
le programme mycsv2xls pour Windows fonctionne comme suit :
mycvs2xls.vbs source_full_path target_directory
mardi 23 mars 2010
Analyse d'écarts dans le temps avec Analysis Services
Par jb le mardi 23 mars 2010, 16:47
Cela pourrait s'appliquer à un "reporting" sur la qualité des prévisions de vente par rapport aux ventes réalisé.
vendredi 13 novembre 2009
Cognos 8 Macro functions list
Par jb le vendredi 13 novembre 2009, 11:24
We have seen that cognos macro functions available in framework manager are also available in report studio.
Here is a simple list of existing Cognos Macro with description.
jeudi 12 novembre 2009
Cognos 8 Report Studio's Conditional block
Par jb le jeudi 12 novembre 2009, 16:51
Conditional blocks allow you to add multiple reports to one page. By defining multiple zones, for example, you can coose between a Synthesis and a detailed table.
mardi 10 novembre 2009
Last period prompt option in Cognos report Studio
Par jb le mardi 10 novembre 2009, 20:42
When you build a new report with some prompts, including a time dimension; you may want to add an option to automatically select the last Period. this way users can :
- see their last data without chosing it in a time tree (but with ability to choose another one).
- schedule a report witch will always select the last period available.
This can be done by using a set containing the #promptmany()# Cognos macro
lundi 9 novembre 2009
SSAS Batch Processing with XMLA
Par jb le lundi 9 novembre 2009, 12:10
When you want to schedule the processing of SSAS database (using Sql Server jobs), you have two options :
- create ans SSIS package containing Analysis services tasks & schedule it.
- Build ans XMLA script & schedule it.
Here we will see how you can build an XML script describing the processing tasks you want to execute.
mercredi 26 août 2009
setup cognos to work with OLAP MSAS cubes security
Par jb le mercredi 26 août 2009, 20:38
Usually, when we create a data source in Cognos, it is easier to specify a connection using Cognos Service Credentials. This means that all connections to the data source are done using the Cognos service user's profile.
- Advantage of this method is that it needs less setup on the corresponding database server (only one account).
- Disadvantage is that you cannot make use of "row level security" as all Cognos users will connect using the same profile (Data source has no information about current Cognos user).
To take advantage of an eventual user level security setup behind Cognos data sources, we need to connect using the current Cognos user's profile.
Row Level security in MSAS
Par jb le mercredi 26 août 2009, 07:11
Security implementation in Analysis Services
In some cases, companies want to give different level of access to strategic data, depending on user’s profiles. Analysis services gives us ability to secure cubes data by building Roles containing security rules, mainly by filtering dimensions data.For example, if you have a cube giving Turnover amounts per salesperson, salesmen should see only the data corresponding to their sales area only. Also, one manager may want to see data for all areas he’s responsible for.
This document describes how we can achieve security on the sales Area axis for the sales domain. Notice taht in this example, we are using Cognos as reporting tool. This addidional layer has no impact on the way we setup MSAS & Active directory, results will be the same with Microsoft Reporting services