Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Friday, March 30, 2012

MULTIPLE INTERSECT in MDX Query - Reg

Hi Everyone,

We are facing some problem in the cube particularly in INTERSECT function.

Here are the details.

Dimension Tables:

DimTime 200601

200602

DimProduct 01

02

DimUser 101

102

103

FactTables:

FactPlayer

Time Product User

200601 01 101

200601 02 101

200601 01 102

Transact SQL Query:

Select Count(*) from

(

Select userid from FactPlayer where productId = 01

INTERSECT

Select userid from FactPlayer where productId= 02

)

PlayerCount

We want the same result from MDX query. Can you please guide us how to do it by using INTERSECT.

Expecting your valuable reply.

Regards

Vijay


Hi Vijay,

You could solve this using the Intersect function, but you don't need to. Here's an example from Adventure Works showing all the Customers who bought products from two different subcategories (mountain bikes and caps):

select {[Measures].[Internet Sales Amount]} on 0,
nonempty(
nonempty(
[Customer].[Customer].[Customer].members,
([Measures].[Internet Sales Amount], [Product].[Subcategory].&[1])
)
, ([Measures].[Internet Sales Amount],[Product].[Subcategory].&[19])
)
on 1
from [Adventure Works]

What it's doing is using the nonempty function to return a list of Customers who bought products in subcategory 1, and then using another nonempty function to filter that list by those who bought products from subcategory 19. This, I think, will be more efficient than using the Intersect function although for the record here's the same query rewritten to use Intersect:

select {[Measures].[Internet Sales Amount]} on 0,
intersect(
nonempty(
[Customer].[Customer].[Customer].members,
([Measures].[Internet Sales Amount], [Product].[Subcategory].&[1])
)
,nonempty(
[Customer].[Customer].[Customer].members,
([Measures].[Internet Sales Amount],[Product].[Subcategory].&[19])
)
)
on 1
from [Adventure Works]

HTH,

Chris

|||

Hi Chris,

Thank you very much. It is working perfectly.

Vijay

|||

Hi Everyone,

We are facing some problem in the cube particularly in INTERSECT function.

Here are the details.

Dimension Tables:

DimTime 200601

200602

DimProduct 01

02

03

DimUser 101

102

FactTables:

FactPlayer

Time Product User

200601 01 101

200601 02 101

200601 01 102

200601 03 101

Transact SQL Query:

Select Count(*) from

(

Select user from FactPlayer where productId = 01

INTERSECT

Select user from FactPlayer where productId= 02

INTERSECT

Select user from FactPlayer where productId= 03

)

PlayerCount

RESULT: 1 (UserId: 101)

We want the same result from MDX query. Can you please guide us how to do it by using INTERSECT.

Expecting your valuable reply.

Regards

Vijay

|||

I found the solution below.

SELECT NON EMPTY{[Measures].[User ID Distinct Count]} ON COLUMNS,

INTERSECT

(

NONEMPTY

(

INTERSECT

(

NONEMPTY

(

[DIM USER].[DIM USER].CHILDREN,

([Dim Time].[TimeKey].&[200602],

[Measures].[User ID Distinct Count],

[DIM PRODUCT].[DIM PRODUCT].&[3])

),

NONEMPTY

(

[DIM USER].[DIM USER].CHILDREN,

([Dim Time].[TimeKey].&[200602],

[Measures].[User ID Distinct Count],

[DIM PRODUCT].[DIM PRODUCT].&[11])

)

)

),

NONEMPTY

(

[DIM USER].[DIM USER].CHILDREN,

([Dim Time].[TimeKey].&[200602],

[Measures].[User ID Distinct Count],

[DIM PRODUCT].[DIM PRODUCT].&[12])

)

)

ON ROWS

FROM [DSV KPI]

Please reply me if there any changes in the query.

Thank You

Vijay

sql

Friday, March 23, 2012

Multiple groupings in table details row

Is there a way to have multiple groupings for a single dataset in a table's
detail row? I need to be able to hide individual grouped data, but still
need to see the hidden data aggregated in the footer row of the table.
The purpose is to make the report easy to read for troubleshooting by hiding
issues that aren't that important but still need to be calculated. Any help
would be greatly appreciated.No
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"joelnbtx" <joelnbtx@.discussions.microsoft.com> wrote in message
news:9783877A-C8AA-4E51-A49F-4EB1D6CC2463@.microsoft.com...
> Is there a way to have multiple groupings for a single dataset in a
> table's
> detail row? I need to be able to hide individual grouped data, but still
> need to see the hidden data aggregated in the footer row of the table.
> The purpose is to make the report easy to read for troubleshooting by
> hiding
> issues that aren't that important but still need to be calculated. Any
> help
> would be greatly appreciated.sql

multiple formulas when suppressing a detail section

I have a report, details a and details b. i need details b to show when a series of formulas are met.

I am having trouble getting this to work:

{loan_main.datepurchased} <> {?Date Purchased} AND not ({loan_query.reivname} like "*wells*")

AND is not performing an AND...

help me please.

thank you :confused::eek: 'AND is not performing an AND...' ?

As you said, you want to show the records when

{loan_main.datepurchased} <> {?Date Purchased} AND not ({loan_query.reivname} like "*wells*")

Right?

I've created a similar formula and it works but in the apposit way: the records which met such a condition are suppressed.
So...... if you want to show those records may be you will change your formula like that:

{loan_main.datepurchased} = {?Date Purchased} AND {loan_query.reivname} like "*wells*" //?

...or correct me if I understood something wrong, please.|||You are correct. I need to show records that meet the criteria, thus i am suppressing records that are on either side.

so, i need to suppress all records

{loan_main.datepurchased} <> {?Date Purchased} AND not ({loan_query.reivname} like "*wells*")

so i would get all loans that are purchased on the date entered upon running the report AND all loans that reivname like wells...

i hope this makes sense.

i am suppressing all the records that do not meet the daily criteria.

thank you|||I've understood what you've written to mean that you want the records with a purchase date of ?DatePurchased, (note the comma) and you want names like wells. i.e. the date is irrelevant for 'wells'.
If so, you want an OR, not an AND.

I find it's easier to write the formula for what records you actually want, and then NOT the whole thing for the suppression formula. e.g.
not( <what you want> )|||I appreciate all help i can get ;)

is it possible to select only the records i want for one section? detail section A is working great, i am having this problem when working with detail section B.

If i can only select records for details section B, i am set...

if not, then besides having two reports, this is it... i think...

i have tried the OR. I need all records that are LIKE 'wells' and date selected is the date purchased.

any help and all help is appreciated.
thank you|||I'm afraid it's still not clear (to me!).

"so i would get all loans that are purchased on the date entered upon running the report AND all loans that reivname like wells..."
The stress on the AND implies to me that you want the union of two sets of data:
1) date entered
2) like wells
i.e. the date is irrelevant for the wells' records, get them all regardless of their date. For non-wells records, base it on the date.

But "I need all records that are LIKE 'wells' and date selected is the date purchased." implies to me that you want
1) date entered and like wells
i.e. only records which satisfy both criteria at once, being wells records for that date.

So which is it?

Maybe you could start at the beginning for us to understand better. e.g. what's in your record selection formula, what you want in detailsA, what you want in detailsB, and whether one record can appear in both detail sections or if they are mutually exclusive.
If mutually exclusive the suppression formulas would be almost the same, e.g. one would be "<formula>" while the other would be "not(<formula>)".|||yes, sorry for the confusion - this report confused me in the beginning too...

I need all records that fit both criteria, datepurchased and like wells.

not one or the other, has to be the date and like wells...

that is why i am trying to use the AND.

hope this makes sense.

thank you...

details A has no formula attached, it shows all records.

thank you|||So I think we've decided that the records you want to show in detailsB are the ones that match both criteria at once :)
The ones you want are therefore:
{loan_main.datepurchased} = {?Date Purchased} AND {loan_query.reivname} like "*wells*"

So the suppression formula is:
NOT (
{loan_main.datepurchased} = {?Date Purchased} AND {loan_query.reivname} like "*wells*"
)

And as someone suggested in a different forum, can either of these fields be NULL?
Also, could 'wells' actually be 'Wells' or 'WELLS' etc.?|||Thank you sooooo much. it worked... :)

i appreciate your help and patience.

thank you sooo much again. it means a lot for the help...|||Glad we got there!

And the reason I always use not(<what I want>) for suppression is because trying to work out the inverse yourself is messy.
e.g. your requirement was effectively "a=x AND b like y"
I believe the logical inverse of that is
not(A<>x OR not(b like y))
which is nearly what you started with, but is nowhere near as easy to understand as what you ended up with.|||I agree. I havent really worked much with crystal, so it is still a learning curve for me... i will deffo use the way you suggested for any future reports.

thank you

Wednesday, March 21, 2012

Multiple details table in Crystal reports

Hi,
Can any one please tell me how can i use multiple details table in crystal reports.
I have a master table and 2 details table. I need to show the master record and the records from the detail tables.
I have created 2 details sections in my report. The problem is that the records from the 2 details tables are coming alternatively. i dont waht that to happen .

Regards
SudeeshUSE SUBREPORTS. tHIS WILL HELP. USE SUBREPORTS FOR EACH OF THE DETAIL TABLE.

KANGKANsql

Multiple details sections, possible?

In a table the details section is called "table1_Details_Group". Is it possible to add a second details group so that I can have the two groups have different group properties?

I'm trying to avoid creating a second table and using an expression to only show one at a time.

Again Thanks.

See this tutorial on adding groupings to a report. It uses a table for an example.

http://msdn2.microsoft.com/en-us/library/ms170623.aspx

|||Thanks but the details section of a table seems not to fit the general information you linked to. For instance I can change the name of any group except the details group and the details group is not grouped on any expression.

I don't think I can create a separate details group, something crystal allows, but was hoping there was a trick or process I was missing.

So to be brief, can one table have more than one details group? If so how is the second detail group created?

|||I don't think I am clear on what you mean by details group. A table can have multiple groups and each group will have it's own set of detail rows based on the grouping expression. Can you give me a better idea of what you are trying to accomplish?|||
Create a brand new table. This table will have 3 sections; a header, a details section/group/ and a footer. Right click on the details section and choose edit group. This will bring up the group information for the details section. For example the name of this group will probably be "table1_Details_Group".

I want to have a second details group in the same table which will have different properties from the first. Can I do this?

|||No it isn't possible. How do you want your data to be displayed? Maybe there is another path to the end result you are looking for.|||FYI, you can insert more rows for the detail group. These have their own properties but they aren't the same as a group. I don't know what particular group properties you are looking for.|||thanks.

Multiple Details In Crystal Report

Hi, I want to create a report which will have two details section in a master section . And I dont want to use subreport. The out put should look like this

MASTER ID - 1001

DETAIL - 1
A - 300
B - 200
C - 400

DETAIL - 2
X- 900
Y- 400
Z- 230

. I want the all the records of "DETAIL 1" to appear first and then all the records of "DETAIL 2" to print . How can I do this without using sub reports
Thanks for your help
-FerozIf possible group the report and suppress group header and details|||can you elaborate a little more .
Thanks|||Hi,

Kindly let me know if anybody has got the solution for this problem?

Thanks in advance|||Include both the tables in the report and link them accordingly.

Create a group Master->field and then its all records will be shown in the details section then the next group will come and its all records will be shown.

You can show the groups name in the Group Header and suppress its footer.|||Thanks a lot for your prompt reply.
Let me be a bit more clear about my requirement:

Hi, I want to create a report which will have two details sections ('Details a' and 'Details b') in a single report.

I am having two unrelated tables with multiple rows.

The out put should look like this:

DETAIL - a
A - 300
B - 200
C - 400

DETAIL - b
X- 900
Y- 400
Z- 230

I want the all the records of "DETAIL a" to appear first and then all the records of "DETAIL b" to print. There is no relationship between two tables. How can I do this without using sub reports.

Appreciate your help in advance!!!|||can you post the tables and report ?

Monday, March 19, 2012

Multiple Datasets

I am trying to write an invoice report for. It will include details of both
companies involved and then list worked hours and expenses on a per project
basis. I need the worked hours to display in a table under each project and
the expenses in a seperate table under each project.
I have tried what seemed to be a simple way... Created on dataset for the
address info of both companies and then a second dataset which contains the
the expeneses and worked hours per project and then created a list for
containing the project name and 2 tables for holding the hours worked and
expenses repectively. I then used filters on each table to display only the
row types it was concerned, expense or hours. Doing this made it so the
parent list failed to render the project name for projects beyond the first.
A second method I though would be to have each table have it's own dataset
and then somehow filter it according to the parent data regions current
project, but can't figure out how to create the join between the 2 datasets.
Any help would be appreciate including maybe a totally different approach to
this problem.
-stanRead up on subreports. A subreport is just a normal report with parameters.
First get the report working with parameters. Then embed it, right click on
the report and set the parameter to the field you want it mapped to in the
main report. Very easy once you get the hang of it.
Bruce L-C
"Stan Huff" <no!_spam!_stanhuff@.yhaoo.com> wrote in message
news:OmVGkGwgEHA.216@.tk2msftngp13.phx.gbl...
> I am trying to write an invoice report for. It will include details of
both
> companies involved and then list worked hours and expenses on a per
project
> basis. I need the worked hours to display in a table under each project
and
> the expenses in a seperate table under each project.
> I have tried what seemed to be a simple way... Created on dataset for the
> address info of both companies and then a second dataset which contains
the
> the expeneses and worked hours per project and then created a list for
> containing the project name and 2 tables for holding the hours worked and
> expenses repectively. I then used filters on each table to display only
the
> row types it was concerned, expense or hours. Doing this made it so the
> parent list failed to render the project name for projects beyond the
first.
> A second method I though would be to have each table have it's own dataset
> and then somehow filter it according to the parent data regions current
> project, but can't figure out how to create the join between the 2
datasets.
> Any help would be appreciate including maybe a totally different approach
to
> this problem.
> -stan
>|||One other note. Filters bring over all the data and then filters it. If you
have a lot of data then this will be very very slow. It will particularly
kill you if you are developing off of a subset of the data and then you go
live with the real stuff which is exponentially bigger.
Bruce L-C
"Stan Huff" <no!_spam!_stanhuff@.yhaoo.com> wrote in message
news:OmVGkGwgEHA.216@.tk2msftngp13.phx.gbl...
> I am trying to write an invoice report for. It will include details of
both
> companies involved and then list worked hours and expenses on a per
project
> basis. I need the worked hours to display in a table under each project
and
> the expenses in a seperate table under each project.
> I have tried what seemed to be a simple way... Created on dataset for the
> address info of both companies and then a second dataset which contains
the
> the expeneses and worked hours per project and then created a list for
> containing the project name and 2 tables for holding the hours worked and
> expenses repectively. I then used filters on each table to display only
the
> row types it was concerned, expense or hours. Doing this made it so the
> parent list failed to render the project name for projects beyond the
first.
> A second method I though would be to have each table have it's own dataset
> and then somehow filter it according to the parent data regions current
> project, but can't figure out how to create the join between the 2
datasets.
> Any help would be appreciate including maybe a totally different approach
to
> this problem.
> -stan
>

Wednesday, March 7, 2012

multiple columns in details section

I have three fields in my report that make up each record. I would like to display these in detail section.

so instead of

1. alam Dept1 10000
2. khaiser dept2 20000
3. mujeeb dept2 20000

I would have

alam khaiser mujeeb ...
dept1 dept2 dept2 ...
10000 20000 20000 ..Use Crosstab Report|||1. Right-click on the dtails section, to open the Section Expert dialog box.

2. On the 'Sections' list, click the details section.

3. On the 'Common' tab, select 'Format with multiple columns' check box. A new tab called 'Layout' appears.

4. On the 'Layout' tab, specify the formatting for the columns:

Enter the width of the column in the 'Width' box. (you can set the height by dragging the section borders in the Design view of the report)

Enter the space between labels going across the page in the 'Horizontal gap' checkbox.

Enter the space between labels going down the page in the 'Vertical gap' box.

Select the printing direction, 'Across then Down' or 'Down then Across'.

Good Luck|||after using the Scetion expert i got mutliple columns but the sum of salary should be in right side but it is not coming ......