Selecting multiple dates from a date hierarchy?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael Weiss (mhweiss_at_hotmail.com)
Date: 09/13/04


Date: Mon, 13 Sep 2004 12:24:09 -0700

Hans,
Try building a string of comma delimited values in your
loop instead of adding them to an array. Then pass this
string like:
objPF.IncludedMembers = Split(mystringofdates, ",")
Hope this helps (actually I just hope it works!lol)
Michael
>-----Original Message-----
>I have a chart with a date hierarchy on the x-axis. I
wrote some
>JavaScript code that can select certain dates, i.e. only
check the
>selected date values in the date measure.
>
>Now I need more functionality that only VBScript seems
to provide so
>I'm trying to convert my JavaScript to VBScript. There's
just one
>problem: the "concat" function in JavaScript doesn't
exist in VBScript
>and I can't concatenate two datearrays with & or +. My
code is shown
>below:
>
>Set objPFS =
ChartSpace1.InternalPivotTable.ActiveView.FieldSets
("Date")
>Set objPC = ChartSpace1.InternalPivotTable.Constants
>
>objPFS.AllIncludeExclude = objPC.plAllInclude
>objPFS.AllIncludeExclude = objPC.plAllExclude
>
>Set objPF = objPFS.Fields("Day")
>
>For i = 0 To 13
> date = date() - i
> year = cstr(year(dato))
> month= monthname(month(dato), False)
> day = day(dato)
> datearray(i) = Array(objPFS.Member.ChildMembers
(year).ChildMembers(month).ChildMembers(day-1))
>Next
>
>objPF.IncludedMembers = datearray ' DOESN'T WORK
>
>objPF.IncludedMembers = datearray(0) ' WORKS but only
shows one
>date
>
>How can I get my datearray with 14 entries into one
single array?
>
>Thanks in advance, Hans Riis
>.
>



Relevant Pages

  • Re: [C++] String assignment
    ... > Hopefully this simple javascript code will explain what I'm trying to do. ... > string and an int, ... No need to use a cumbersome array when we have the ... > but itıs param requires a char pointer and I need to work with an unsigned ...
    (alt.comp.lang.learn.c-cpp)
  • Re: VBscript Array Split Function
    ... I would like to create a function within a VBScript where I will enter ... a string and that person's first name is ... inputted into an array so that each separate character in the array is ... To create an array of characters from a string in a language without a ...
    (microsoft.public.scripting.vbscript)
  • Re: VBscript Array Split Function
    ... the string is already an array of chars and can be accessed by using ... Dim psuedoARRAY ... Subject: VBscript Array Split Function ...
    (microsoft.public.scripting.vbscript)
  • VBscript Array Split Function
    ... I would like to create a function within a VBScript where I will enter ... a string and that person's first name is ... inputted into an array so that each separate character in the array is ... but I am not 100% sure on the delimiter syntax. ...
    (microsoft.public.scripting.vbscript)
  • Re: split ByteArray
    ... it's actually a string - but one of a very peculiar nature. ... However, VBScript ... A byte array is strictly a vector, so it cannot be accessed with two dimensions as requested. ... the linear address must be computed from the presumed/assigned dimensions for the ...
    (microsoft.public.scripting.vbscript)