7 Replies Latest reply: Jul 15, 2015 4:03 AM by LeitArt LeitArt

# timerange in set analysis

Hi there,

I've got a Problem with a Set Analysis Term. I am trying to set at dynamic Timerange and its not properly working.

{1<Timerange ={'>=\$(=Date(WeekStart(Max(Timerange))))<=\$(=Date(Max(Timerange)))'}>}

Its working if I do a selection, but it doesn't any other way.

Has anybody an idea where the problem is?

Thanks for your Help.

• ###### Re: timerange in set analysis

Not sure why the above is not working, can you try this:

{1<Timerange ={"\$(='>=' & Date(WeekStart(Max(Timerange))) & '<=' & Date(Max(Timerange)))"}>}

I would make sure that I get the same format for this expression: ='>=' & Date(WeekStart(Max(Timerange))) & '<=' & Date(Max(Timerange)) in a text box as Timerange.

HTH

Best,

Sunny

• ###### Re: timerange in set analysis

I would avoid the single-quotes and use double-quotes for the search-expression and would make sure that the formatting is identically like this from Timerange then max() will return a numeric-format and date() will apply the default date-format which might not match like suggested from stalwar1:

{1<Timerange ={">=\$(=Date(WeekStart(Max(Timerange)), 'YourFormat'))<=\$(=Date(Max(Timerange)), 'YourFormat')"}>}

- Marcus

• ###### Re: timerange in set analysis

I tried both options (yours and sunnys) with the same result I've got.

The results of the single parts work very well in the textboxes. It's the combination that drives me crazy

Perhaps it helps if I give you the whole function:

Sum({1<[Parameter1]={'A'},[Parameter2]={'B'},Timerange={">=\$(=Date(WeekStart(Max(Timerange)),'DD.MM.YYYY'))<=\$(=Date(Max(Timerange)),'DD.MM.YYYY')"}>} [Value])

If I select at least Parameter1 or Timerange I receive the correct Sum of Value. (even if I select the wrong Parameter1).

Sometimes I'm going Nuts with Set Analysis...

-Roman

• ###### Re: timerange in set analysis

Would you be able to share your application or a sample?

• ###### Re: timerange in set analysis

The app is kind of big and complex. I'll try to extract a sample from it.

• ###### Re: timerange in set analysis

It sounds that the associations between those data within the datamodel isn't suitable - probably you have some kind of snowflake-sheme maybe with linktables which could cause these problems.

- Marcus

• ###### Re: timerange in set analysis

That may be the case. That would at least mean, that I have not been tricked by Set Analysis this time.

I will dive into my datamodel. Thanks for the suggestions. I'll keep you in touch.

-Roman