Alexander Koblov · May 16, 2016 go to post

As far as I know it is not possible to switch it on.

You might find function DESCENDANTS (http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2RMDX_Descendants) helpful.

For time dimension, all members of the level are generated and available to queries that show empty. This means

SELECT DESCENDANTS([DateOfSale].[YearSold].&[2015],DateOfSale.DaySold) ON 1 FROM HoleFoods

will show all days from 2015 on rows, whether there are facts recorded for those days or not.

Alexander Koblov · May 20, 2016 go to post

strace ccontrol list on my Ubuntu shows that ccontrol looks in file /usr/local/etc/cachesys/cache.reg

Alexander Koblov · May 27, 2016 go to post

As far as I know office365.com requires STARTTLS that is supported as UseSTARTTLS property of %Net.SMTP starting with Cache 2010.2

Alexander Koblov · Jun 8, 2016 go to post

Hi Blaise.

Does following query looks like what you need?

With Member Measures.[RunningTotal] As 
     'AGGREGATE(%TIMERANGE(DateOfSale.[Actual].[MonthSold].&[201101],DateOfSale.CurrentMember),
                MEASURES.[Amount Sold])',FORMAT_STRING='$#,#.#' 
SELECT {Measures.[Amount Sold],Measures.[RunningTotal]} ON 0,  
        [DateOfSale].[Actual].YearSold.&[2016].CHILDREN ON 1 
FROM HOLEFOODS

It prints two columns -- Revenue in current month and Total revenue from 2011-01 up to current month. Rows are months of 2016 year.

Alexander Koblov · Jun 13, 2016 go to post

Hi Randy.

FILTER option in SETTINGS references "Allowed Default Values for Filters" section of doc http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_settings#D2IMP_filter_default_values

You can specify set of members as follows:

"{&[keyval1],&[keyval2],&[keyval3]}"

Then you need to URL encode this value: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_dashboards#D2IMP_dashboard_url_encoding

Particularly by replacing & with %26 and , with %2C

For example, if I want to pass to "Basic Dashboard Demo" several values for Home Zip Code filter I need to create following string:

&SETTINGS=FILTER:[HomeD].[H1].[ZIP].{&[32006],&[32007]}

And then URL encode it to

&SETTINGS=FILTER:[HomeD].[H1].[ZIP].{%26[32006]%2C%26[32007]}
Alexander Koblov · Jun 22, 2016 go to post

Message "An error occurred with the CSP application and has been logged to system error log (^ERRORS)"

means that you can check error in Management Portal -> System Operation -> System Logs -> Application Error Log -> [Namespace]

Or for debugging purposes set error page for web application to %CSP.Error.cls http://docs.intersystems.com/cache20161/csp/docbook/DocBook.UI.Page.cls?KEY=GCNV_R2015_2#GCNV_C140105

and see errors on the page itself

Alexander Koblov · Jun 23, 2016 go to post

I usually create new empty DB, then ^GBLOCKCOPY globals from old DB. And then replace old DB with the new one.

Alexander Koblov · Jul 1, 2016 go to post

Hi Cheng Cheng.

%DeepSee.ResultSet has property %UseCache to make query not to use cache. You can set it if you run using %DeepSee.ResultSet directly.

As far as I know this is not configurable from Analyzer or User Portal. And it cannot be set system- wide or for particular cube.

Regards, Alexander.

Alexander Koblov · Jul 6, 2016 go to post

I wonder if this extra line is caused by the line break between </script> and the xml header.

Can you try to move

<?xml version="1.0" encoding="UTF-8" ?>

Before <script> ?

Alexander Koblov · Jul 12, 2016 go to post

Documentation explains both functions well and with examples, so I encourage you to look into them. Especially first two examples for %ALL function

ALLMEMBERS -- function that returns a set of all members of the given level or hierarchy http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2RMDX_AllMembers

%ALL -- function that enables you to use a member while ignoring any ROW and COLUMN context that uses the hierarchy to which this member belongs. http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2RMDX_percentAll

As to your question about calculating percentage of the top level, here is sample that for each product calculates revenue percentage of total from all products (2nd column) and from category for this product (3rd column).

Sample pivot

RevenuePctOfAllProducts and RevenuePctOfParent are calculated measures that defined as follows:

RevenuePctOfAllProducts:

Measures.[Amount Sold] / SUM(Product.[All Product].%ALL, Measures.[Amount Sold])

RevenuePctOfParent:

Measures.[Amount Sold] / SUM(Product.CurrentMember.Parent, Measures.[Amount Sold])

So the full query looks like:

WITH
MEMBER [MEASURES].[RevenuePctOfAllProducts] AS 
    'Measures.[Amount Sold] / SUM(Product.[All Product].%ALL, Measures.[Amount Sold])' 
MEMBER [MEASURES].[RevenuePctOfParent] AS 
    'Measures.[Amount Sold] / SUM(Product.CurrentMember.Parent, Measures.[Amount Sold])'
SELECT NON EMPTY {[Measures].[Amount Sold],
                  [MEASURES].[REVENUEPCTOFALLPRODUCTS],
                  [MEASURES].[REVENUEPCTOFPARENT]} ON 0,
    NON EMPTY HEAD(NONEMPTYCROSSJOIN([Product].[P1].[Product Category].Members,[Product].[P1].[Product Name].Members),2000) ON 1 
FROM [HOLEFOODS]
Alexander Koblov · Jul 15, 2016 go to post

Hi Raghu.

I don't know about XPath, but maybe using XSLT might help you here:

Class Sample.XSLTransform [ Abstract ]
{

ClassMethod test()
{
	set tXML= ##class(%GlobalCharacterStream).%New()
	do tXML.Write("<HHSOS><DIAGNOSES><DIAGNOSIS_DATA><DIAGNOSIS_DATA_GUID>3762875</DIAGNOSIS_DATA_GUID><DIAGNOSIS_DATA_GUID>37628752</DIAGNOSIS_DATA_GUID></DIAGNOSIS_DATA><DIAGNOSIS_DATA></DIAGNOSIS_DATA><DIAGNOSIS_DATA></DIAGNOSIS_DATA><DIAGNOSIS_DATA_GUID>37628753</DIAGNOSIS_DATA_GUID></DIAGNOSES></HHSOS>")
	
	set tXSL=##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1)_"||ExampleXSL").Data
	
    set tSC=##class(%XML.XSLT.Transformer).TransformStream(tXML,tXSL,.tOutput)
    zwrite tSC
    set tSC=tOutput.OutputToDevice()
}

XData ExampleXSL
{
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
    <xsl:copy-of select="//DIAGNOSIS_DATA_GUID[1]"/>
</xsl:template>
</xsl:stylesheet>
}

}

SAMPLES>d ##class(Sample.XSLTransform).test()
tSC=1
<?xml version="1.0" encoding="UTF-8"?><DIAGNOSIS_DATA_GUID>3762875</DIAGNOSIS_DATA_GUID><DIAGNOSIS_DATA_GUID>37628753</DIAGNOSIS_DATA_GUID>
Alexander Koblov · Jul 27, 2016 go to post

Hi Trevor.

The other question is why do you need this? What is the end goal that you want to achieve?

Thank you, Alexander.

Alexander Koblov · Aug 11, 2016 go to post

Hi Ponnumani.

You cannot run class itself in Caché. You can run some classmethod of this class.

For example from terminal you can run classmethod 'PrintPersons' of class Sample.Person as follows:

USER>zn "samples"

SAMPLES>do ##class(Sample.Person).PrintPersons()
 
Name: Klein,Agnes E.
Name: Willeke,Imelda R.
Name: Vanzetti,Rhonda Y.
...

I encourage you to read "Caché Programming Orientation Guide". http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT

Particularly it contains information on how you can use terminal to test your programs: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_ch_devtools#GORIENT_devtools_terminal

Alexander Koblov · Sep 15, 2016 go to post

You don't need to set DSTIME parameter in the secondary class.

However, OBJ.DSTIME and SynchronizeCube does not see changes in objects of secondary class.

That is the case mentioned as

The changed record is not in the extent of the base class used by the cube.

in documentation (http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_current#D2IMP_current_overview_cannot_use_dstime)

For example, let's say that you have cube Person based on Sample.Person class.

And that class Sample.Person has property Job that references persistent class Sample.Company.

If you just modify object of Sample.Company as follows:

set p = ##class(Sample.Company).%OpenId(100)
set p.Name = "New Company Name"
write p.%Save()

Then this change will not be seen by SynchronizeCube and you'll need to update cube manually: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2IMP_ch_current#D2IMP_current_manual_updates

Adding DSTIME parameter to the Sample.Company does not help as original cube Person is not based on this class.

Alexander Koblov · Nov 16, 2016 go to post

Albert,

you second option should work. I've just tested it on 2016x1.

Probably the reason of error is last comma between END and WHERE:

END,
WHERE CodigoNum IN ('100','101')
Alexander Koblov · Nov 28, 2016 go to post

Maybe just tools?

Do you think there will be other tools mentioned on Community other than tools for developers?

Alexander Koblov · Dec 22, 2016 go to post

I would look into some kind of string distance measures. For example, Levenshtein distance.