November 2, 2016 at 11:41 pm
Bonjour,
Je suis nouveau sur SSRS, et je souhaiterais savoir si vous avez une idée car je suis bloqué...
Bon, j'ai un dataset composé des données de mon rapport (Date, Montant vente, Ville, Partenaire, Article), et j'ai mis un paramètre "date" dans mon rapport.
Ce que je souhaite avoir maintenant est un montant de vente pour chaque article à une date où l'année est l'année N-1 de l'année de la date seléctionner sur le paramètre.
Exemple : si je selectione la date 23/10/2016 j'obtiens le montant de la vente pour la date 23/10/2015
Ma source de données est une CUBE (SSAS), donc le requette est en MDX.
Merci d'avance pour vos suggestions.
Tsiry
November 3, 2016 at 1:03 pm
(Sorry, response in English) If I understand the Google translate correctly, you'll need to add something to your query to also include the sales from a year ago. Here's a pseudo-code example:
SELECT
sale_date
,SUM([Amount sale]) as Sales
FROM sales
WHERE sale_date = @date
OR sale_date = DATEADD(YEAR, -1, @date)
GROUP BY sale_date
November 3, 2016 at 1:16 pm
doug.brown (11/3/2016)
(Sorry, response in English) If I understand the Google translate correctly, you'll need to add something to your query to also include the sales from a year ago. Here's a pseudo-code example:
SELECT
sale_date
,SUM([Amount sale]) as Sales
FROM sales
WHERE sale_date = @date
OR sale_date = DATEADD(YEAR, -1, @date)
GROUP BY sale_date
I believe that you understood correctly, except for the part that the OP needs to get the MDX query instead of T-SQL.
I know it's possible but my skills on MDX are just enough to understand it, but not create new code.
La plupart des utilisateurs de ce forum parlent anglais et seulment quelques-uns parlent français. Vous obtiendrez une meilleure aide si vous publiez en anglais.
November 3, 2016 at 7:20 pm
Luis Cazares (11/3/2016)
I believe that you understood correctly, except for the part that the OP needs to get the MDX query instead of T-SQL.I know it's possible but my skills on MDX are just enough to understand it, but not create new code.
Perhaps the op can translate SQL to MDX. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
November 4, 2016 at 9:55 am
Jeff Moden (11/3/2016)
Luis Cazares (11/3/2016)
I believe that you understood correctly, except for the part that the OP needs to get the MDX query instead of T-SQL.I know it's possible but my skills on MDX are just enough to understand it, but not create new code.
Perhaps the op can translate SQL to MDX. 😉
I'm not sure if it's that easy. It also depends on how the time dimension is built. There's an option for previous member which can be used if the dimension has year as part of the hierarchy.
November 4, 2016 at 11:54 am
Luis Cazares (11/4/2016)
Jeff Moden (11/3/2016)
Luis Cazares (11/3/2016)
I believe that you understood correctly, except for the part that the OP needs to get the MDX query instead of T-SQL.I know it's possible but my skills on MDX are just enough to understand it, but not create new code.
Perhaps the op can translate SQL to MDX. 😉
I'm not sure if it's that easy. It also depends on how the time dimension is built. There's an option for previous member which can be used if the dimension has year as part of the hierarchy.
I was expressing a bit of irony. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply