Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Thursday, March 22, 2012

Bar chart report(grouping datetime info yearly, monthly, etc...)

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

sql

Bar chart report

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

Tuesday, March 20, 2012

Baffled trying to display a parameter label

I have two parameters: year and month. The Month parameter includes All, 1, 2, ect..

I tried to display the parameter slected with the following expression:

=IIf(Parameters!DateShippedMonth.Label="All",Parameters!DateShippedMonth.Label,

MonthName(Parameters!DateShippedMonth.Label)) & ", " & Parameters!DateShippedYear.Label

I want it to either display the label (All) or the name of the month. I get an error when All is the parameter selected but not when any month is selected. If I removed the MonthName() function, I don't get an error but I also don't get the month name.

Any ideas?

What error are you getting?

The MonthName takes an integer as MonthNumber. If you are using the parameter label, then I would assume that you are trying to pass a string to the MonthName function.

If you are indeed displaying a number 1,2, 3 etc in the month parameter, then try a CInt function around the label.

BobP

|||I tried both with and without CInt() in the MonthName function. If the parameter selected is a month I don't get an error, which is strange as I SHOULD get an error when I'm NOT using the CInt(). I only get an incorrect input string was not correct format when I add the MonthName function. If I run MonthName alone I get the error on the "All" parameter which is why I tried to pull out the "All" parameter with the IIf|||

It looks like it is validating the MonthName function on it's own, outside the context of the IIF.

So I did this to get it to work:

=IIf(Parameters!DateShippedMonth.Label="All",Parameters!DateShippedMonth.Label,

MonthName(iif(Parameters!DateShippedMonth.Label="All",1,Parameters!DateShippedMonth.Label))) & ", " & Parameters!DateShippedYear.Label

BobP

|||

Thanks. I'll try that. I already wrote some custom code to resolve the problem but this looks easier. Although I think I have to use custom code to translate a fiscal period of, say 4, which is really July of the previous year.

Thanks again!

|||

If you are reporting off of a Data Mart/Data Warehouse, your dimDate dimension should take care of that.

Other wise you can use the TSQL function DateName:

Quarter = DateName(q,@.CurDate)

BobP

|||I'm doing mdx queries from a cube and my dimDate month is in integers. If I change it to month names they don't sort correctly.

Baffled trying to display a parameter label

I have two parameters: year and month. The Month parameter includes All, 1, 2, ect..

I tried to display the parameter slected with the following expression:

=IIf(Parameters!DateShippedMonth.Label="All",Parameters!DateShippedMonth.Label,

MonthName(Parameters!DateShippedMonth.Label)) & ", " & Parameters!DateShippedYear.Label

I want it to either display the label (All) or the name of the month. I get an error when All is the parameter selected but not when any month is selected. If I removed the MonthName() function, I don't get an error but I also don't get the month name.

Any ideas?

What error are you getting?

The MonthName takes an integer as MonthNumber. If you are using the parameter label, then I would assume that you are trying to pass a string to the MonthName function.

If you are indeed displaying a number 1,2, 3 etc in the month parameter, then try a CInt function around the label.

BobP

|||I tried both with and without CInt() in the MonthName function. If the parameter selected is a month I don't get an error, which is strange as I SHOULD get an error when I'm NOT using the CInt(). I only get an incorrect input string was not correct format when I add the MonthName function. If I run MonthName alone I get the error on the "All" parameter which is why I tried to pull out the "All" parameter with the IIf|||

It looks like it is validating the MonthName function on it's own, outside the context of the IIF.

So I did this to get it to work:

=IIf(Parameters!DateShippedMonth.Label="All",Parameters!DateShippedMonth.Label,

MonthName(iif(Parameters!DateShippedMonth.Label="All",1,Parameters!DateShippedMonth.Label))) & ", " & Parameters!DateShippedYear.Label

BobP

|||

Thanks. I'll try that. I already wrote some custom code to resolve the problem but this looks easier. Although I think I have to use custom code to translate a fiscal period of, say 4, which is really July of the previous year.

Thanks again!

|||

If you are reporting off of a Data Mart/Data Warehouse, your dimDate dimension should take care of that.

Other wise you can use the TSQL function DateName:

Quarter = DateName(q,@.CurDate)

BobP

|||I'm doing mdx queries from a cube and my dimDate month is in integers. If I change it to month names they don't sort correctly.sql

Bad startup parameter on clustered instance

Hello,
I inadvertantly mis-edited the SQL startup parameters on a clustered
instance and now the instance won't start. I'm wondering if there's a quick
fix to correct the problem. (short of uninstall/reinstall <g>)
I've researched this and am aware of the problems changing the local
registry not being persistent due to the cluster-shared reg overwriting the
local version. What I guess I'd like to do is force an overwrite of the
cluster version of the reg setting from the local node. Is there a way to do
this?
Thanks,
Randy Rabin
Well, you shouldn't directly edit the registry entries of a cluster-aware
app like a clustered SQL Server in the first place. That's totally
unsupported. From what you said, you are probably stuck in a vicious cycle.
No matter how hard you try to edit the startup parameter back to its correct
value, your entered value will be overwritted by the bad value, causing the
SQL Server resource to keep failing the startup.
This is because the cluster service checkpoints its changes and basically
replicates the registry changes, and your entered value is overwritten by
the checkpoint saved by the cluster service.
But there is a way to get out of the vicious cycle.
1. Remote console to the node that currently owns the offline SQL Server
group.
2. Open a command prompt on the node, and start up the SQL Server from the
command line with the correct parameters, something like the following:
cmd>sqlservr -sMSSQLSERVER -c -dE:\MSSQL\Data\master.mdl -eE:\MSSQL\Log\errorlog
-le:\MSSQL\Data\master.ldf
** (If this doesn't work, see Note below)
3. Once SQL Server is running, start up Enterprise Manager, and change your
startup parameter(s) there to their correct value. This is critical because
the change made through Enterprise Manager will be saved by the cluster
service in a checkpoint, and will be replicated to the other nodes.
4 . Go to Cluster Administrator, bring up SQL Server resource online.
5. Check the registry entries for the startup parameters to make sure tht
they are still correct, and they should be correct at this point. This step
is not necessarily. But it's just a sanity check.
6. Move the SQL Server resource group to a different node. It should come up
online on that node.
7. Check the registry entries for the startup parameters on the node to make
sure they are correct, and they should be because the startup parameter
value should have been replicated over by the cluster service from the first
node you worked on.
8. Repeat Step 6 and 7 on all the remaining nodes.
**Note that I'm typing this from my recollection. For Step 2, it may also
work if you first edit the local registry to correct the startup parameters,
and then start the SQL Server service on the command line using net start.
If Step 2 as described above doesn't work, give this a try. I know for sure
that this alternative would work for SQL Server 2005 when it's stuck in the
same situation.
***DON'T EVER DIRECTLY EDIT A CLUSTERED SQL SERVER REGISTRY ENTRIES
AGAIN****
Linchi
"Randy Rabin" <randyr@.channeladvisor.com> wrote in message
news:%23mlrK1N0FHA.2212@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I inadvertantly mis-edited the SQL startup parameters on a clustered
> instance and now the instance won't start. I'm wondering if there's a
> quick
> fix to correct the problem. (short of uninstall/reinstall <g>)
> I've researched this and am aware of the problems changing the local
> registry not being persistent due to the cluster-shared reg overwriting
> the
> local version. What I guess I'd like to do is force an overwrite of the
> cluster version of the reg setting from the local node. Is there a way to
> do
> this?
> Thanks,
> Randy Rabin
>
|||Hi Linchi,
Thank you for the response, but I don't appreciate the soapbox. In fact I
*had* used Enterprise Manager to edit the startup parameter in the first
place. EntMgr wrote the incorrect parameter to the cluster-shared copy of
the registry, which then of course got replicated down to the nodes. The
"fix" I had tried was to re-edit the local node's registry (and yes, I never
do this and agree that normally nobody else should either <g>) and obviously
found out quickly that it wasn't going to work.
I did get the SQL instance running again after a 2-hour call to PSS and a
utility that allowed me to reset the value in the cluster-shared copy of the
registry. Thanks for your solution below, perhaps it will help others.
Regards,
Randy
"Linchi Shea" <linchi_shea@.NOSPAMml.om> wrote in message
news:ubi5OCU0FHA.3780@.TK2MSFTNGP12.phx.gbl...
> Well, you shouldn't directly edit the registry entries of a cluster-aware
> app like a clustered SQL Server in the first place. That's totally
> unsupported. From what you said, you are probably stuck in a vicious
cycle.
> No matter how hard you try to edit the startup parameter back to its
correct
> value, your entered value will be overwritted by the bad value, causing
the
> SQL Server resource to keep failing the startup.
> This is because the cluster service checkpoints its changes and basically
> replicates the registry changes, and your entered value is overwritten by
> the checkpoint saved by the cluster service.
> But there is a way to get out of the vicious cycle.
> 1. Remote console to the node that currently owns the offline SQL Server
> group.
> 2. Open a command prompt on the node, and start up the SQL Server from the
> command line with the correct parameters, something like the following:
>
cmd>sqlservr -sMSSQLSERVER -c -dE:\MSSQL\Data\master.mdl -eE:\MSSQL\Log\erro
rlog
> -le:\MSSQL\Data\master.ldf
> ** (If this doesn't work, see Note below)
> 3. Once SQL Server is running, start up Enterprise Manager, and change
your
> startup parameter(s) there to their correct value. This is critical
because
> the change made through Enterprise Manager will be saved by the cluster
> service in a checkpoint, and will be replicated to the other nodes.
> 4 . Go to Cluster Administrator, bring up SQL Server resource online.
> 5. Check the registry entries for the startup parameters to make sure tht
> they are still correct, and they should be correct at this point. This
step
> is not necessarily. But it's just a sanity check.
> 6. Move the SQL Server resource group to a different node. It should come
up
> online on that node.
> 7. Check the registry entries for the startup parameters on the node to
make
> sure they are correct, and they should be because the startup parameter
> value should have been replicated over by the cluster service from the
first
> node you worked on.
> 8. Repeat Step 6 and 7 on all the remaining nodes.
> **Note that I'm typing this from my recollection. For Step 2, it may also
> work if you first edit the local registry to correct the startup
parameters,
> and then start the SQL Server service on the command line using net start.
> If Step 2 as described above doesn't work, give this a try. I know for
sure
> that this alternative would work for SQL Server 2005 when it's stuck in
the[vbcol=seagreen]
> same situation.
> ***DON'T EVER DIRECTLY EDIT A CLUSTERED SQL SERVER REGISTRY ENTRIES
> AGAIN****
> Linchi
>
> "Randy Rabin" <randyr@.channeladvisor.com> wrote in message
> news:%23mlrK1N0FHA.2212@.TK2MSFTNGP15.phx.gbl...
to
>