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

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.

Related

How to get this chart to show numbers instead of squares

I transferred the file from Excel into my Tableau sheet and created two new variables. One is a parameter based on the Sales variable. I set the value at 10,000. Then I created a calculated variable called "Sales Spotlight" that states:
IF(SUM([Sales])) >= [Sales Parameter] THEN "Good" ELSE "Bad" END
This is what the screen looks like:
The result is correct except the values in the table are string values instead of number values. I can't figure out how to change the data in the table to numbers.
To confirm, you want to display Sales as a number in your chart?
In theory, you should be able to do this by changing Mark type from "Automatic" to "Number" (or "Text"?).
Failing that, try dragging Sales from the far-left side on to your viz under Rows, and again explicitly set the Mark type.
Proviso: it's been a while since I've used Tableau and I don't have it available so cannot verify the answer above but it should work.

Fetching date value from a SharePoint-list, to use in date&time specific field in flow

I'm trying to design a Microsoft Flow, which will create a outlook calendar event entry based on information in a SharePoint-online list.
The list will contain a value for a DueDate its a column of type Date, not including time.
I want to be able to create a outlook calendar entry on the date based off the duedate column. The calendar entry form in flow allows via dynamic content to add dates that also include time, however date columns not containing time cannot be added that way.
Is there a workaround to this, some expression that would allow me to fetch values from columns more freely and then possible append a time to it
I have tried converting the column in sharepoint to a Date with Time column and that workaround worked, however its not what I'm looking for. Id like to know how to be able to work around this because I don't necessarily want my column as a date-time column which can cause problems later on.
I have tried this expression:
formatDateTime(concat(item()?['DATE'], '08:00')'yyyy-MM-ddThh:mm:ss')
But I know this is wrong and it doesn't work. I'm simply not sure how to do it.
https://puu.sh/Df5ni/05cb882b23.png
I want the flow to add a calendar entry based off the due date column which i can append my own time to like the start of the day and last til the afternoon.
Actual results are I don't seem to be able to use a date column, just a date-time column for start and end times of the event, date column without time doesnt appear in the dynamic content list.
If there is some way to manually fetch values instead of using the dynamic content that is very powerful and can then possibly be converted to the right format using additional code.
Date column name in my list is date_without_time of type Date (Add time set to NO):
New element:
Function used in Create event (V2) action:
formatDateTime(triggerBody()?['date_without_time'],'yyyy-MM-ddT09:35')
Result:
Calendar:

Retrieve Format of a NotesViewColumn

Is there a way to find out which format applies to a NotesViewColumn? I can see that there are a number of format attributes e.g. DateFmt, TimeDateFmt, NumberFormat etc, but what I can't see is a way to identify which one of them applies.
Combine your current column's value type with NotesViewColumn's format attributes.
If your current column value is of type number then use
NotesViewColumn's NumberFormat, NumberAttrib, NumberDigits format.
If your current column value is of type NotesDateTime then use
NotesViewColumn's DateFmt, TimeDateFmt, TimeFmt, TimeZoneFmt format.
Assuming you are able to read NSF design, you could rely on DXL export to get the information needed. Try the DXL utility on Tools - DXL Utilities - Viewer:
As you may find, the piece of information you need is nested inside every <column> node.
For number columns there is a <numberformat> node.
For time columns there is a <datetimeformat> node above <numberformat>.
For text columns there is nothing.
In case you need to programaticaly analyse a number of views, there is the NotesDXLExporter on hand.

Creating Custom Date Function in Excel

I am trying to code a date function in Excel using the Month and than the last two digits of the year. So for example I just have the numbers 1-12 in a column. Then I want to code them as follows. 1 is Jan-15, 2 is Feb-15,..June-15. Then 7 is July-14, 8 is Aug-14. However whenever I try to type in those it codes them as their respective month, the day and the year as 2015. I know I have to create a custom format date function, but how would I go about doing that in this case. I have seen some things, but many of times it is unclear. Could Someone help me out.
This link can help you out.
Create a custom date format
If you want to use a format that isn’t in the Type box, you can create your own. The easiest way to do this is to start from a format this is close to what you want.
Select the cells you want to format.
Press CTRL+1.
In the Format Cells box, click the Number tab.
In the Category list, click Date, and then under Type, pick a date format that is close to the format you want.
Go back to the Category list, and pick Custom. Under Type, you’ll see the format code for the date format you picked in step 4. The built-in date format can’t be changed, so don’t worry about messing it up. The changes you make will only apply to the custom format you’re creating.
In the Type box, make the changes you want using code from the table below.
According to the table there and your description I suppose you should use a custom format like:
mmm-yy

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";

Resources