Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to make a set analysis variable that takes a parameter, so I can pass in any date I want.
Like so:
vDateSetAnalysisExpr = {$ <Year=, Month=, Week=, Date={'$1'}>}
And then I would use it like so:
sum($(vDateSetAnalysisExpr('1/1/2012')) Revenue)
But I haven't been able to get it to work. If I use the same set analysis expression variable using a literal '1/1/2012' in the variable itself, it works just fine.
Any thoughts on if this is possible, and if so how?
Thanks,
-Simon-
I found my problem...
In the set analysis variable, where i had
Date={'$1'} //<-- WRONG
I should have had
Date={$1} //<-- RIGHT - no quotes!
*sigh*
Thanks Mayil!
Hi
If so, can you check the format for date? its also in dd/mm/yyyy format?
I found my problem...
In the set analysis variable, where i had
Date={'$1'} //<-- WRONG
I should have had
Date={$1} //<-- RIGHT - no quotes!
*sigh*
Thanks Mayil!
Simon,
Where did you write the expansion variable, in the script?
vDateSetAnalysisExpr = {$ <Year=, Month=, Week=, Date={$1}>}
Wilfredo,
I used the variable in charts like so:
sum($(vDateSetAnalysisExpr('1/1/2012')) Revenue)
to get the sum of revenue for just 1/1/2012, etc.
And if I want to use it with a variable, I can do it like this:
sum($(vDateSetAnalysisExpr('$(=date(v3WeeksBack))')) Revenue)
I found it necessary to do this even if the variable (v3WeeksBack in this case) is already a date. Putting it in a dollar expansion with an eqauls sign $(=date(v3WeeksBack)) forces it to be evaluated before being passed to the set analysis variable as a parameter.