COGNOS: Crosstab displays values with memberset/hierarchy but not with specific members - cognos

I have a question based on crosstab in Cognos. I need to display values based on months. Due to i dont have an time hierarchy i need to create a year/month group by myself. I have a datefield that contains only dates per day. In this case i created a new field that groups the datefield based on year/month.
Monat = cast(extract(year; [Reference Date]);varchar (4)) + '/' + cast(extract(month; [Reference Date]);varchar(2))
I am using this Element (Monat) in my crosstab as displayed below. Now the problem occurs - as soon as i drag the hierachy(Reporting Structures) into the crosstab (marked red) i got the correct values, but if i drop a specific member (COGNOS_Bericht) out of the hierachy it doesnt display any values. Does anyone had any similiar problem and knows how to solve it?
Thanks in advance

It could just be that there is no data at that intersection. If you replace the row edge with children([ALL]) what does the crosstab look like. Additionally, given you are in a dimensional source, it would probably best to do the time calcs in an actual time dimension.

Related

Taking means of irregular amounts data

I'm not able to take the means for a large dataset given that the amount of attributes is irregular.
I have posted a simplified case for the problem. It explains the problem very well.
An idea that I came up with: Make a filter to condition on a single attribute. However, still, I don't see a way to do this in an efficient way (other then doing it all by hand).
see excel file:
All help is much appreciated.
I'm basically looking for a function/method to achieve taking means of all different attributes conditioned on each person for a large dataset without doing it by hand.
You can use AVERAGEIFS() inside an IF:
=IF(OR(A2<>A1,B2<>B1),AVERAGEIFS(C:C,A:A,A2,B:B,B2),"")
the ifrst part of the if tests whether the row starts a new group either by the person or the attribute changing. Then it uses AVERAGEIFS() to return the correct average of that group. otherwise it returns a blank
What you want to do can be accomplished very simply with a pivot table.
Simply select one of the cells inside the range of data you want to process(See the video for general use of a pivot table https://www.youtube.com/watch?v=iCiayB6GrpQ )
go the insert tab and insert pivot table.
Once you have it, simply check people, attribute, and values. Then drag people and attribute into rows, drag valut into the values window, select the drop down list and change it from sum of value to average and you should be done. https://i.stack.imgur.com/nYEzw.png

Fix the structure of the SSRS Matrix

I have been working on a small project. I am trying to display all the results in the same row without NULL values. I've written a small expression to remove the Null values already "=IIF(IsNothing(Fields!RegisterNo.Value),True,False)". However, the rows seem to be moving one level down as it is displayed in the picture ResultMatrix1. I want the results to be on the same level. Can you please tell me if this is possible and how I can achieve it. Is it something to do with the groupings or something else?
Design Groupings
By default, when you create a table, there is a Row Group called "Details" that is not actually grouped by anything. This causes it to produce one row for each row from the dataset. Since you are trying to group these, you need to make sure that innermost group is grouped by your Staff Ref No.
In the lower-right cell, you may need to change the expression to use a Max function. This will simply avoid arbitrarily showing blanks when they happen to be sorted before a real value within that group.

Excel - Nested IF/Nested AND/OR in 'calculated field' option - pivot table

I have the following problem:
A datasheet with a column (HOUR) and another column (AM/PM). Entries in the first column consist of 1,2,3,4,5,6,7,8,9,10,11, or 12, the second column consists of 'AM's or 'PM's. Together they define the time of an incident (regarding the below problem, note that I am not allowed to create a new column in the source datasheet or change existing columns). The below formulas 1.) to 3.) work excellent for getting '1's or '0's for incidents that happened either between 8AM and 4PM, or outside of this time window, as long as I create a new column somewhere.
1.) =IF(AND(A1>=8, A1<=11),IF(B1="AM",1,0),0) + IF(AND(A1>=1, A1<=4),IF(B1="PM",1,0),0) + IF(AND(A1=12),IF(B1="PM",1,0),0)
2.) =--OR(AND(A1>=8, B1="AM", A1<>12), AND(OR(A1<=4, A1=12), B1="PM"))
3.) =--OR(AND(OR(A1={8,9,10,11}),B1="AM"), AND(OR(A1={1,2,3,4,12}), B1="PM"))
However, I want the "1"s to be summarized - without creating an extra column - as calculated field in a pivot table. While excel doesn't accept the 3.) formula at all in the calculated field option, excel accepts 1.) and 2.), but puts out only "0"s in all pivot cells. The below is one of the formulas that puts out only "0"s in the pivot table.
=--OR(AND(HOUR>=8,'AM/PM'="AM",HOUR<>12), AND(OR(HOUR<=4,HOUR=12),'AM/PM'="PM"))
The field value settings don't make a difference, and the fields that are created new with 1.) or 2.) cannot be filtered for "1"s or 0"s, so something must be wrong with the field calculation I guess. Does anybody know what I need to change to make it work? Are there special rules for formulas in pivot tables that apply to formula 1.) and 2.) to make them work?
Thanks for any help on this
I think the limitation is not you, but Excel.
See here for description of what is possible, as well as this question
I tried your code and indeed I see it's not working. Even with a simple if code it doesn't seem to work. I think it's is explicitly called a calculated field because you are only able to calculate the fields in the Sum/Total/Count etc. column.
Have a look at MS, this function is quite limited.
I would try to make another work-around to accomplish your goal.
Microsoft

how to display sum of field in axgridview

I'm working with Microsoft Dynamics AX R3,2012 and i want to add a group by field in an dynamics:AxGridView then a sum for a certain field by the group field indicated then the total sum without the group by .Please help me .i didn't find a solution.like what described in this page http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
You can create a display method to compute your sum on each row. If you do so, don't forget the 'cacheAddMethod' in order not to compute it each time. This is the "historical" way.
More info on display methods.
Or you can create a view and use computed column in it. It will depends on your current datamodel and query you want to run.
More info on computed column in views.
Thanks for your reply,My Problem is not to create display method but the Problem is how to display the sum of subtotal by this display field.So my solution is to add GroupField in the AxGridView with designed field like GoalId in my case.then in the AxGridView i create template field with footer containing label not visible in default. So in rowdatabound i do the total by the new group that known with a test in rowcreated in GoalId 's value changes .Then when i get a new group i put the value of cumul of the previous value of a the previous group and in the footer template i display the total of all rows.this is the solution and thanks so much for your help. but now the problem that i noticed that axgridview have problems after updating data with a groupby fields and with template field.it display noting in this fields

Error in Calculated Column (using Today) in DataSheet View - Sharepoint 2010

I have calulated column which display's the value based on the difference between today and requested date field.
=Today-[Requested Date]
This is working fine in Sharepoint Standard View. But the same is not working with the datasheet view . The calculated column is showing as below
=#NAME?-[Requested Date].
Due to this i am not able to save the data. Can anyone please let me know how to solve this ?
Which SharePoint version are you using?
I tried the same scenario using SharePoint 2013 and was able to add the values in both standard and datasheet views. I am assuming you might have used the same steps.
Create 2 new columns named RequestedDate(DateTime) and
Today(Single line of text).
Add a new column of type calculated field with formula
=Today-[Requested Date].
Now delete the Today column.
Try entering the data in both the views.
First I have used today() function to calculate difference between 2 days except working days. The list is not automatically updating. If we change the Start_Date, then it calculates and gives the value. Can you suggest me why this happens?
You have mentioned in your post that there is some tricks in using today() function. I have created separate Today_Date column in my list. And Used the same column name in finding difference between 2 days. Here also the same problem exists.
The formula I used is,
=IF(AND((WEEKDAY([Today Date],2))<(WEEKDAY([Release Date],2)),((WEEKDAY([Release Date],2))-(WEEKDAY([Today Date],2)))>1),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)))
Please tell me how to make the difference between 2 date values update automatically every time I open the list.
Then I tried the trick which you have mentioned above. But it works while I enter the data. When I open the list for the next day or some other day's after the Calculated column is not taking the current day's value, do the data remains same. what should I need to do in case it needs to take current date's value and calculate the formula?

Resources