SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Recuperantion des données pour certains dimensions


Recuperantion des données pour certains dimensions

Author
Message
tsiryelhy
tsiryelhy
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 9
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
doug.brown
doug.brown
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3448 Visits: 18009
(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


Luis Cazares
Luis Cazares
SSC Guru
SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)

Group: General Forum Members
Points: 96314 Visits: 21215
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.


Luis C.
General Disclaimer:
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?


How to post data/code on a forum to get the best help: Option 1 / Option 2
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)

Group: General Forum Members
Points: 511879 Visits: 44306
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

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Luis Cazares
Luis Cazares
SSC Guru
SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)SSC Guru (96K reputation)

Group: General Forum Members
Points: 96314 Visits: 21215
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.


Luis C.
General Disclaimer:
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?


How to post data/code on a forum to get the best help: Option 1 / Option 2
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)SSC Guru (511K reputation)

Group: General Forum Members
Points: 511879 Visits: 44306
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

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search