go to post Alessandro Marin · Jun 5, 2018 There is no direct equivalent in ObjectScript to the ternary operator. You can use $SELECT or $CASE
go to post Alessandro Marin · Mar 31, 2018 Those listings in italics are defined in Listing Groups. You can find them in SMP > DeepSee > Tools > Listing Group Manager > Open > Additional Listing for HoleFoods SampleThey work in MDX:Do $SYSTEM.DeepSee.Shell()>>DRILLTHROUGH SELECT FROM [holefoods] %LISTING [Another Sample Listing by Date] "Custom Listing" is the listing that you construct in pivots using Listing Fields, see here: Display a Detail Listing. I have not checked the code but to me it makes sense that, if defined on the pivot, "Custom Listing" will not be available for general MDX queries.
go to post Alessandro Marin · Mar 19, 2018 In spite of the fact that your queries do not show dates nor the PARTEPOLICIAL cube, I do not think related cubes change anything from what suggested in answer 2 here: https://community.intersystems.com/post/filters-deepsee-dashboards . Below I rephrase what was suggested:A) Create a "myDate" pivot variable used as "Literal" and of type "Day" in your main cube, which I will assume is EVENTOSPOLICIALES.B) Define two calculated dimensions. First get the spec of the two dates from your main cube. You can drag and drop dates and inspect the MDX query. For example, the specs will be something like:[Some dimension].[H1].[Fecha Creacion][Relation to PARTEPOLICIAL].[Some other dimension].[H1].[Fecha Parte]C) Create two calculated dimensions with Local Storage. The expressions should use the specs in B and the pivot variable in A, for example:[Some dimension].[H1].[Fecha Creacion].$variable.myDate[Relation to PARTEPOLICIAL].[Some other dimension].[H1].[Fecha Parte].$variable.myDateD) Use the calculated dimensions as filter or in rows/columns for your pivots. The dashboard will have to have a widget with a Apply Pivot Variable control.
go to post Alessandro Marin · Mar 19, 2018 That happened because calculated members and pivot variables are stored in globals. One way to export folder items together with related supporting items is to follow the procedure described here:http://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_moving#D2IMP_folder_manager_export_container
go to post Alessandro Marin · Nov 9, 2017 You can find the link to Management Portal in the documentation: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSA_using_portal To see if the instance is running: I suggest getting familiar with the ccontrol command from terminal: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSA_using_instance#GSA_using_instance_controlFor example, ccontrol list will list basic information about your instance. This is an example on my (Linux) computer where you can see that the first instance is down and the second is running: amarin> ccontrol listConfiguration 'C152' directory: /home/amarin/intersystems/cache20152 versionid: 2015.2.1.705.0 datadir: /home/amarin/intersystems/cache20152 conf file: cache.cpf (SuperServer port = 56778, WebServer = 57778) status: down, last used Fri Jul 7 09:37:47 2017Configuration 'C161' directory: /home/amarin/intersystems/cache20161 versionid: 2016.1.0.610.0 datadir: /home/amarin/intersystems/cache20161 conf file: cache.cpf (SuperServer port = 56777, WebServer = 57777) status: running, since Wed Nov 8 11:33:16 2017 state: ok
go to post Alessandro Marin · Oct 25, 2017 No problem, your case (no time part in the timestamp, just get the fact that comes last in your source table) is even easier. Once you make the fact order in your source table work this plugin should work.This plugin uses SensorReading, but it is possible to make it more dynamic (hint: implement a filter definition and %OnGetListingFields). /// Use this plugin in a calculated measure as %KPI("User.LastFact","LASTFACT",1,"%CONTEXT")Class User.PluginLast Extends %DeepSee.KPIPlugIn{/// Cube(s) that this plug-in is based on.Parameter BASECUBE = "*";/// SourceTableParameter LISTINGSOURCE = "SourceTable";Parameter PLUGINTYPE = "Pivot";// The ID is probably not even needed:Parameter LISTINGFIELDS = "SensorReading, %ID as ID";XData KPI [ XMLNamespace = "http://www.intersystems.com/deepsee/kpi" ]{<kpi name="User.LastFact" displayName="LastFact" caption="LastFact" ><filter name="%cube" displayName="Subject Area"/><property name="LASTFACT" displayName="LastFact" description="" /></kpi>}/// Get the base query for this plug-in.Method %OnGetMDX(ByRef pMDX As %String) As %Status{ Set tBaseCube = "" // Use %cube filter to find the base cube If $IsObject(..%filterValues) { If (..%filterValues.%cube'="") { Set tBaseCube = ..%filterValues.%cube } } If (tBaseCube'="") { Set pMDX = "SELECT FROM "_tBaseCube } Quit $$$OK}/// Compute the LastFact of values within the result set.Method %OnCompute(pSQLRS As %SQL.StatementResult, pFactCount As %Integer) As %Status{ Set tSC = $$$OK Try { Set tErrMsg = "" While (pSQLRS.%Next(.tSC)) { If $$$ISERR(tSC) { Set tErrMsg = $System.Status.GetErrorText(tSC) Quit } // Get the last fact added to the table. If unsure use pSQLRS.ID Set tValue = pSQLRS.SensorReading If ($ZSTRIP($P(tValue,":"),"<>W")="ERROR") { Set tErrMsg = $P(tValue,":",2) Quit } } // place answer in KPI output Set ..%seriesCount = 1 Set ..%seriesNames(1) = "LastFact" If (tErrMsg'="") { Set ..%data(1,"LASTFACT") = tErrMsg } Else { Set ..%data(1,"LASTFACT") = tValue } } Catch(ex) { Set tSC = ex.AsStatus() } Quit tSC}}
go to post Alessandro Marin · Oct 24, 2017 In Steve's example there are multiple (two) facts in one day, and he need to get the latest. IMO this means that Steve need to get the time of the reading (or maybe get the reading in a certain day that was added to the source table last). When using time dimensions we do not have a level more granular than DayMonthYear that can compare the time part of a reading.I tried working around this problem but so far without success. With a plugin we have access to the lowest-level data, in particular the whole time stamp containing the time of the reading (I am assuming Steve used in his source class a regular time stamp). In my test I was able to use that piece of information to get all readings in one single period (day, month,..), compare the time stamps, and return only the most recent.Unless Steve is ok with using Average as the aggregation function for his SensorReading measure as suggested by Asaf
go to post Alessandro Marin · Aug 30, 2017 Hello Razvan,I assume you are starting from the last figure in the tutorial where the pivot in the figure has the Count measure on Columns.Your calculated member is considered a measure because it performs a calculation, not a "pure" aggregation of facts. Two measures cannot be crossjoined (that is you cannot place one under the other, or one in the Columns and the other in the Measures box),and for this reason you see an error. In this page you can find more details on why you cannot crossjoin two measures:https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCNV_R2015_2 That said, try creating a "Percentage" calculated measure with this expression: 100 * (%CELLZERO(-1,0) - %CELLZERO(-2,0))/%CELLZERO(-1,0)and place it in the Columns box (do not crossjoin it with Count though!). I hope this helps.
go to post Alessandro Marin · Apr 9, 2017 One way to do this is by using a pivot variable. Create the same pivot variable "Region" in both pivots on which your widgets are based. These pivot variables should return the members, in your example Asia, Europe, N. America, S. America. You can define the manually or in a termlist, or use a kpi to retrieve them. For the example in the screenshot below I created a HoleFood2 cube with a Outlet2.H1.Region2 level. This level is "incompatible" with an Outlet.H1.Region level in HoleFoods. In my manual Region pivot variable I simply defined two regions, which can be selected manually. Once you have these two pivot variables create a calculated dimension on each pivot using the pivot variable. In your example in HoleFoods the expression should be Outlet.[$variable.Region]. Place the calculated dimension on Filters.This is how I did it in HoleFoods:and this is how I did it in HoleFoods2:Finally, add an ApplyVariable control on one of your widgets with "*" as target. Selecting a region will filter both widgets.
go to post Alessandro Marin · Apr 5, 2017 %LAST evaluates a measure or numeric expression for the last non-empty member of a set, so I do not think that is what you want.I am using %LASTCHILD, but you cannot append it to [DateOfSale].[Actual].[MonthSold].Members because %LASTCHILD only works on specific member. For the moment I found this solution:WITH MEMBER [DateOfSale].[LastDayOfMonth] AS '[DateOfSale].[Actual].[MonthSold].CurrentMember.LASTCHILD' SELECT [Measures].[Amount Sold] ON 0,NON EMPTY NONEMPTYCROSSJOIN([DateOfSale].[Actual].[MonthSold].Members,[DATEOFSALE].[LASTDAYOFMONTH]) ON 1 FROM [HOLEFOODS]The resulting headers are ugly and I have not yet been able to successfully use [DateOfSale].[Actual].[MonthSold].CurrentMember.Properties("Name")