Range filter on a dimension in SAP Analytics Cloud - sap

I need to create a range filter in SAC and to create range filter in SAC, column should either be date or number type.
I wanted to create a range filter on a Dimension but in SAC dimension is automatically converted into Text.
I am using excel to upload my data, I formatted the data in excel and made that dimension as number in it but once I upload the file in SAC that dimension automatically gets converted to Text.
I there any solution to this use case?

You can try to create Measure based dimensions and give it a try. Since SAC will accepts measure as numeric. I hope this may help you.

Related

Redaction in Tableau

I am currently in the process of building some Tableau workbooks where we will need to redact visualizations or text tables if the results fall below a certain threshold (e.g. only ten data points are returned after filters are applied). Does anyone know how to create calculated fields or know of other methods to redact in Tableau?
You can create a threshold filter that compares the number of filtered responses to a threshold value set in a parameter.
First, create a parameter with integer data type and set it to the desired threshold. In this example, I called it Count Threshold.
Then create a calculated field for the filter with an equation like the following:
{FIXED: COUNTD([Respondent ID]) >= [Count Threshold]}
(I did this for survey results where we needed to hide results if the filtered number of respondents was fewer than 10.)
For the threshold filter to be applied after your other filters, choose "Add to Context" for your other filters.
I found a partial solution on the Tableau community forum/knowledgebase about redaction that might work for other implementations.
The basic idea is to create two different calculated fields, one which displays a integer value and the other that displays a string value. That way, when both are concatenated in the display you get the desired output without breaking any of the calculated field rules.
So create a calculated field that has a formula like:
IF sum([Datafield_to_Redact]) < 10 THEN "*" ELSE str(sum([Datafield_to_Redact])) END
And another that has a calculated field that has a formula like:
IF sum([Datafield_to_Redact]) < 10 THEN null ELSE sum([Datafield_to_Redact]) END
In the post the attached workbook and screenshot show how the two values are concatenated in the Text mark.
Workbook screen capture

PowerBI Dynamic Time Series BarChart

Adding on my previous question here: TimeSeries question
I would like to plot a unit capacity chart over a Time series (which contains a range of dates set by the user).
The chart I am trying to plot is as follows:
For each Unit Name, I have start and end date for the unit capacities, as shown in the PowerBI table as below:
4 sub questions:
How to plot these capacities over time? Maybe using some DAX functions?
Do i need the SSAS cube to solve this problem or can I do all the work inside PowerBI desktop? If not, is there a better way for example in SSRS?
Is there a way to make the x-axis time series dynamic as specified by the user?
Adding to this, after Leonard's response. After converting the OutageStartDateOrig, and OutageEndDateOrig values I tried to create the calculated column as suggested in the youtube link {enter link description here}. However, the DAX formula as shown in the video gives out a syntax error for me stating that the '.' is incorrect when specifying the range of dates. Any ideas for this? [Screenshot below]:
To create such a visual, I'd recommend an area chart (or stacked area chart) with the date on the axis, the unit name on the legend, and the capacity on the values. You could also do it as a stacked column chart too. However, then each date will be broken into discrete columns. See below image.
In terms of data manipulation, you'll need to convert the data with the date ranges you have above into a row for each individual date & unit. E.g. the first row, instead of being 11/2 to 13/2, would be expanded into 3 rows, one for each date.
You can do this in Power Query as you bring the data into Power BI Desktop, or in DAX after bringing it in. There are several solutions to this outlined in this thread (https://community.powerbi.com/t5/Desktop/Convert-date-ranges-into-list-of-dates/td-p/129418), but personally, I recommend the technique (and video) posted by MarcelBeug (https://youtu.be/QSXzhb-EwHM).
You'll also want an independent list of dates (with no gaps) to join the final date column to - otherwise your visual will skip dates when no units had capacity. By default, the chart will begin on the first date with data and end on the last date with data, so in that sense it is dynamic, but you can add a date slicer to give the end-user more control.
Area chart on top, column chart on bottom, date slicer on right filtering Jan-Mar.

Formatting measure based on dimension attribute

This may be very basic. I'm trying to change the format string used on a measure based on the attribute of a dimension connected to the measure. I'm doing this in a calculated measure at the moment.
Essentially, the fact table row contains a value for the ID of the dimension, and that dimension has the format information I want. I'd like to apply formatting based on that value, without the dimension being required in my query.
something like this:
WHEN [Format Source].[Hierarchy].CurrentMember.Properties("Format") is [Format Source].[Format].&[Number (123)]
THEN FORMAT([Measures].[Volume], "#.#")
I'd like this formatting to be applied regardless of having the dimension in the query, as I won't always have control over how the reports the users create. The data could be whole number or % with differing levels of decimal precision, based on the attribute of the format dimension.
I think that I may just be way off on this one, thanks in advance for any help

How to make MDX Range operator less restrictive?

I have a date dimension I want to filter on. I use MDX Range (:) operator for that. The problem is it appears that range bounds must be valid members of a set. I have IntDate attribute in my Date dimension, and it's an integer in the YYYYMMDD format. When I browse the dimension, there are 20120705 and 20120706 values, but not 20120704 or 20120707. Still, as far as range is concerned, both 20120705:20120706 and 20120704:20120707 encompass 20120705 and 20120706 and I hoped would return 20120705 and 20120706. But when first one works as expected, second returns empty set. The reason I need loose range to work is that users may enter date range that is not based on data in the dimension. How can I make this work?
The one that works:
The one that returns empty set.
Thank you,
Vlad.
Since your 20130707 member doesn't exist, the cube can't know where it was supposed to go.
It seems odd that you have a date dimension that doesn't contain all of the days in a month. I would suggest repopulating your date dimension so that it has all dates. You can get a fully populated date dimension from the Azure data market if you are using a tabular cube. If you are using multidimensional, you can have SSAS generate one for you. If you have parameters built off of dates, you can limit the list to populate them to show only the data for which there are measures using Exists.
I also wonder why you want users to enter dates rather than choose dates from a valid list. How do you handle the errors when they enter a value that is simply invalid? It seems the easiest/safest choice is to give them the list of dates from which to choose. If they are entering things that don't have data and you have error handling, the result should be the same as if they choose from a valid list.
That being said, you should be able to so something like the below. I check to see if the date is a valid member. If it isn't I substitute the first valid member I find in the list of members (you could choose your own date and insert it there). For the end of the range, I find the last valid member (again, you can substitute your own value).
{Iif(Count(Exists([Date].[Int Date].members, [Date].[Int Date].[20130704]))>0,[Date].[Int Date].[20130704], [Date].[Int Date].firstchild):
Iif(Count(Exists([Date].[Int Date].members, [Date].[Int Date].[20130707]))>0,[Date].[Int Date].[20130707], [Date].[Int Date].lastchild)}

Pentaho Report Designer: How to create a chart based on an OLAP cube?

Using Pentaho Report Designer, I can successfully display my OLAP cube's data as a table.
But when I want to display the same data as a chart, it always fail saying "CHART.USER_NO_DATA_AVAILABLE".
Actually, I don't really know what I should enter for category-column and value-columns. I tried:
category-column = [Area].[prefecture]
value-columns = [[Product].[Product.Product].[All Products].[productA]]
And any other variation I could think of, but no success. Any idea? Thanks!
My OLAP cube is a Pentaho Analysis: sales count for each product and prefecture.
Just use:
[Product].[Product.Product].[All Products].[productA]
You only need the extra square brackets around the entire fieldname if it's a formula.
Or pick the field from the dropdown.. then you know you have the right one!
If you're doing a timeseries xy, note you have to repeat the category column value as many times as the value column.
also make sure you have a series name too.