You are not logged in.

Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "Pommie" is male
  • "Pommie" started this thread

Posts: 412

Date of registration: Feb 21st 2007

Location: Lytham UK

Occupation: OLAP consultant specialising in retail

  • Send private message

1

Friday, October 16th 2009, 11:37am

Set Data and Strings

Apologies for posting this here - there is no VBA category here and this eemed the closest.

I have a macro that uses SetData and it works fine with values but if I try (legitimately) to use it to set an A into a String Element it shows "#VALUE" briefly and does not enter the A.

Is this a bug or is there a different syntax for posting string data? If not how do we achieve it? As indicated in the wish list are spreading witha ! won't work either.

I really don't want to have to ask my users to enter a letter 53 times for each category!!!!
Best wishes

John Hobson
The Planning Factory, Lytham, UK
www.planfact.co.uk

  • "h_decker" is male

Posts: 763

Date of registration: Oct 26th 2005

Location: Cologne, Germany

  • Send private message

2

Friday, October 16th 2009, 1:30pm

RE: Set Data and Strings

John,

Quoted

Originally posted by Pommie
I have a macro that uses SetData and it works fine with values but if I try (legitimately) to use it to set an A into a String Element it shows "#VALUE" briefly and does not enter the A.


I just tried this by setting a string attribute "active" of my product dimension like this:
application.Run("PALO.SETDATA","Y",false,"localhost/Demo","#_Products","Active","All Products")

Works fine for me and returns Y.

Did you check the element types twice? ;-)

I have to mention that I still use 2.5.

Holger

This post has been edited 1 times, last edit by "h_decker" (Oct 16th 2009, 1:31pm)


  • "Pommie" is male
  • "Pommie" started this thread

Posts: 412

Date of registration: Feb 21st 2007

Location: Lytham UK

Occupation: OLAP consultant specialising in retail

  • Send private message

3

Friday, October 16th 2009, 4:42pm

Holger

Many thanks - you set me on the right track - I had a source variable being picked up from the spread sheet as either a number or a string and was creating a palo.setdata formula programmatically.

I had stupidly ignored the fact that a string needs to be surrounded by quotes so once I had added this test

If IsNumeric(sSourceValue) Then
sSourceValue = sSourceValue
Else
sSourceValue = Chr(34) & sSourceValue & Chr(34)
End If

(Yes I could shorten that by testing only for false couldn't I?)

then the palo.setdata started to work fine.

Thanks again


Quoted

I have to mention that I still use 2.5.


SO do I :D Doesn't everybody?
Best wishes

John Hobson
The Planning Factory, Lytham, UK
www.planfact.co.uk

This post has been edited 1 times, last edit by "Pommie" (Oct 16th 2009, 4:43pm)


  • "h_decker" is male

Posts: 763

Date of registration: Oct 26th 2005

Location: Cologne, Germany

  • Send private message

4

Friday, October 16th 2009, 5:17pm

John,

Quoted

If IsNumeric(sSourceValue) Then
sSourceValue = sSourceValue
Else
sSourceValue = Chr(34) & sSourceValue & Chr(34)
End If


Yes, you can use

If not IsNumeric(sSourceValue) Then
sSourceValue = Chr(34) & sSourceValue & Chr(34)
End If

Holger

This post has been edited 1 times, last edit by "h_decker" (Oct 16th 2009, 5:17pm)


Rate this thread