Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

7 Replies
sunny_talwar

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

marcus_sommer

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 sunindia:

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

- Marcus

Not applicable
Author

Thanks for your reply.

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

sunny_talwar

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

marcus_sommer

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

Not applicable
Author

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

Not applicable
Author

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