Cognos 11.1.7 asterisk appearing in a calculated field. How do I tell Cognos not to show the asterisk? - cognos

I have a calculated field in a crosstab formatted as a percent with 1 decimal place
The calculation works fine
The results however show an asterisk (after the percent sign) even when exported to Excel
What I have found on some web searches is Cognos shows an asterisk when the unit of measure is unknown. Not sure if this applies to what I am doing with Cognos
The calculation is B divided by A

I solved the (annoying) issue (in a crosstab column) by:
Define content of the Crosstab intersection: yes
Unlock report
Drag and drop in the cell a Text Box
Change the textbox Source Type to Report Expression
Insert the calculation as a Report Expression instead of a query calculation

I found an answer, set the format to custom and enter the data pattern
For example,
##0.0%

Related

Excel Power Query truncating text field to 1024 characters

I am accessing a SSAS DMV through Power Query in Excel via:
let
Source = AnalysisServices.Database(TabularServerName, TabularDBName,
[Query="select * from $SYSTEM.TMSCHEMA_EXPRESSIONS"])
in
Source
This works great in Power BI, but in Excel, the Expression column is limited to a max of 1024 characters. How do I get Power Query in Excel to give me the entire value? My largest values are around 15000 characters, so still within the stated limits of Power Query that I can find.
If I set up a table with a connection and query behind it, Excel can pull in the entire Expression column, but the downside is the server and database cannot be parameterized and have to be manually changed in the connection. Also I don't remember how to do this manually, so I always have to access the DMV from DAX Studio and export to Excel to set it up!
Update
I did some heavy transformations of this column. I parsed out a value, I used it to merge the file with itself and add a column that I then did a bunch of transformations on, and then used it to replace text within the original problem column. And something in that pulled in the whole value. I tried just doing small parts of this, like adding a column that referenced the problem column, or doing a replace in the problem column, and none of that worked.
So, no, not easy to duplicate or figure out which step fixed it, but for my purposes, I now have what I need.
I think it is related to the type of the column your are loading in Excel. I had the same issue and read your answer (with Table.ReplaceValue).
Your solution is hiding the initial point : The function used in the expression you shared for Table.ReplaceValue() is Replacer.ReplaceText that as the additional specificity to convert a field of type Any
to type Text.
I tried to juste change the type of my field that was truncated when loaded in Excel, from type Any to type Text. Result : the complete values were then loaded in my worksheet.
I had to change this query today, and after I changed it, the values were truncated again. I added a Replace Value step at the end of the query on the truncated column and that seemed to fix it.
#"Replaced Value" = Table.ReplaceValue(#"Last Step","in ","in ",Replacer.ReplaceText,{"Truncated Column Name"})
in
#"Replaced Value"

SSAS dates not working in an Excel filter

In my SSAS cube I have a dimension that includes 6 date fields. They are all defined in the same way, with a Key field that is a date type and a Name field that is char(10) in format yyyy-mm-dd.
When I include those fields in an Excel pivot table, they all work fine except one. That one field is displayed correctly, but doesn't behave correctly when filtered. In particular, specifying a between filter always returns zero rows. Same with a greater than filter. Begins with works fine.
Once again, this only happens for one of the six date fields. But all six date fields are configured identically as far as I can tell. What type of mistake could cause this?
EDIT
Using SQLServer Profiler I can see that the MDX generated from Excel are identical for the dates that work and the one that doesn't (except for the field names changing of course). If I restrict the pivot table to a single date and add a between filter then the MDX is:
SELECT NON EMPTY Hierarchize({DrilldownLevel({[Participation Program].[Participation Start Date].[All]},,,INCLUDE_CALC_MEMBERS)})
DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME ON COLUMNS
FROM (SELECT Filter([Participation Program].[Participation Start Date].[Participation Start Date].AllMembers,
([Participation Program].[Participation Start Date].CurrentMember.member_caption>="1985"
AND [Participation Program].[Participation Start Date].CurrentMember.member_caption<="1990")) ON COLUMNS
FROM [Compass3])
WHERE ([Child].[Child is Handicapped].&[T],[Measures].[Child Count]) CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS
That returns correct results for [Participation Start Date], but if I do the same thing with [Participation Stop Date] it returns 0 results. So it is a problem on the SSAS side rather than Excel side. But I still can see no difference in the way the two dates are configured in the cube, and I am 100% certain that there is data that should match the specified date range.
I would change the Key for those attributes to a numeric representation of the date in YYYYMMDD format. I would achieve this via a SQL View where I would use the CONVERT function.
I would not use the date datatype at all in SSAS, as it's internal representation is obscure/uncertain.
I've come across a similar problem using epplus. If you haven't defined the date explicitly, Excel may not realize that the data is a date. This causes problems with sorts and filtering. (Note that the code below is C#, but the idea behind it with respect to the excel formulas/formats should be the same.)
When you generate the excel cell, explicitly define a date formula in the cell:
ws.Cells[rowCount, columnCount].Formula = "=DATE(" + myDate.ToString("yyyy,M,d") + ")";
Then, set the cell formatting to display the date the way you want:
ws.Cells[rowCounter, columnCount].Style.Numberformat.Format = "d-mmm-yyyy";

Filtering a PivotTable by Boolean

The source data for my Excel PivotTable looks like the following (this is a simplification):
id name score
1 john 15
2 james 2
3 pat 14
4 jake 12
...
I have a PivotTable that uses this as a data source. Now, what I want to do is have the PivotTable only consider entries if their id is less than 100. This is theoretically achievable by having a Report Filter on id, and de-selecting any number greater than 100. But that's rather absurd.
How can I filter out data using a Boolean constraint? I've tried various methods, none of which worked. It seems like calculated fields are the key, but it doesn't seem possible to create a filter on calculated fields.
I'm using Excel 2011 for Mac, if that makes a difference. I'm a programmer, but I've never programmed in Excel, so if that's the solution, I'd request baby steps. :) Thank you!
AFAIK, In Excel 2011, you cannot use a report filter to apply any kind of filter. You have to manually check/uncheck the values that you want or don't want.
The alternative that I can think of is to insert a column before your data and enter the formula
=If(B2<100,TRUE,FALSE)
and copy it down using Autofill. (See screenshot below)
Now create a pivot and put the field "Less Than 100" in the report filter and simply select TRUE (See screenshot below)
If you don't want to go down that path then move the ID field to ROW LABEL from REPORT FILTER where you can use a filter.
A Report Filter is exactly what I would do, but rather than manually de-selecting the fields as you suggest you would do I would apply a Label filter to be less than the cut-off point, which in your example is 100.
I haven't used Excel on Mac, but on Windows on the PivotTable Field List, to the right of the id field click the little black arrow, and select Label Filters -> Less Than and then enter 100 in the dialogue that pops up.
Given the inherent value of PivotTables is the ability to apply filters exactly for this sort of scenario I don't think I'd do anything more complicated.

Cognos frame work manager: format numeric column to show currency dynamically

In this url, it is shown how you can format a particular column to according to particular currency.
http://publib.boulder.ibm.com/infocenter/caapps/v10r1m0/index.jsp?topic=%2Fcom.ibm.swg.im.cognos.ug_fm.10.1.0.doc%2Fug_fm_id13919format_SAP_query_items.html
Now in a result set, there may be 2 rows and each may be of a different currency and also different number of decimals. According to the method here, it seems that we need to hard code the currency and the number of decimals on the entire column. Is there a way to set it dynamically?
I have two columns in the result set, one is the amount the other one is the currency. Based on currency, i want to format the amount column. From db, the amount column just comes back as a number.
How can I do it?
I can't think how this would be done in Framework Manager. You can do it in Report Studio however.
He are some high level instructions on how to do it in Report Studio:
In Condition Explorer, create a variable which results in a different string for each currency. For example if your currency code field is [Table].[CurrencyCode] and it has things like 'AUD','CAD' etc. in it then your variable expression would just be the field:
[Table].[CurrencyCode]
This will simply output the currency as its result
Still in the variable creation screen, add values the the 'Value' window to for each possible currency code result
Go to the report page, click on the field that contains your actual currency value (i.e. 13.50 and set it's Style Variable property to the variable that you just created
Now go back to condition explorer and select your first currency
Ensure your currency value field is selected and edit the 'Data Format' field to the appropriate format
Repeat 4 & 5 for each currency
Here is another guide to how to do this:
http://www-01.ibm.com/support/docview.wss?uid=swg21339405
This is called 'Conditional Formatting' if you would like to research it further.
Unfortunately this solution needs to be done at the report level and can't be done down at the the FM level. I'm not aware of a way that you can conditionally set the data format in FM like this.

Some but not all Excel numbers show as a date

I have a big .xls file. Some numbers show as a date.
31.08 shows as 31.aug
31.13 shows as 31.13 (that is what i want all columns to be)
When I reformat 31.aug to number it shows as 40768,00
I have found no ways to convert 31.aug to 31.08 as a number. All I am able to do is to reformat 31.aug as d.mm and then it shows as 31.08 and when I try to reformat it from 31.08 to number it shows as 40768,00. No way to cheat Excel using different types of cell formats.
How's your regional settings? There are some Regions where the short date is identified by dd.mm.yyyy. (Estonian, for instance). Maybe if you change the regional settings for US / UK and paste the data again it won't be changed.
Worked in a small test I did here. Hope it helps.
Internally Excel stores Dates as integer. 1 is January 1. 1900. If you entered something that Excel interprets as a date then it will be converted into an integer. I think from this point on there is no way back.
There is an setting in Options on the tab "international" where you can define your decimal separator. If you set this to ".", then your Excel should accept 30.12 as decimal number and not as date.
As pointed out by others, Excel interprets some of your data as a date instead of a number, which depends on your regional settings. To avoid this happening try Tiago's and stema's responses, they will work depending on your regional settings.
To repair your problem in a large file after it has happened without re-entering/re-importing your data, you can use something like
=DAY(B5)+MONTH(B5)/100
to convert a "date" back to a number. Excel will still display it as a date when you first enter this, but when you reformat it as "Number" now it will display the value you originally entered.
Since your column seems to contain a mix between correct numbers and dates, you need to add an if() construct to separate the two cases. If you haven't changed the display format yet (i.e. it still displays 31.Aug) you can use
=IF(LEFT(CELL("format";B7);1)="D";DAY(B7)+MONTH(B7)/100;B7)
which checks if the format is a "D"ate format. If you have already changed the format to Number, but know all your correct data is below 40000, you can use
=IF(B5>40000;DAY(B5)+MONTH(B5)/100;B5)
As suggested above, go to Control Panel - Region and Language - Advanced Settings - Numbers - and change the Decimal Symbol from "," to "."
Good luck!
The data you are pasting, is it by any chance a pivot table.
For example, like you, I am copying a lot of data into a large spreadsheet. The data I am copying is from another sheet and it is a pivot table.
If I paste normally, half will show up as numbers, which they are in the source file and half will show up as dates, for no reason, which drives me insane.
If I Paste->Values however, they will all show up as numbers, and as I don't need the pivot functionality in the destination file this solution is fine.
All you have to do is format cell.
1-right click on the cell where you want to insert the number.
2-then click on Number and select 'General' from the number menu.
Hope this will help future people with the same issue.

Resources