5 Replies Latest reply: Aug 9, 2011 4:06 AM by Paul Geudens

Need some help with set_expressions !!

Hi

I'm quite new to QV so it might be a very simple question to answer for some of you...

I have a chart (graph) with a dimension lets say Category and Date (MMM-YYYY). What I'm trying to do is limit the Date-selectionbox to 1 selectable value that represents 1 month of 1 year. The graph then needs to show the selected month compared with 3 previous months. As expression lets say I just want to count the A-values so something like Sum(if(Value='A',1,0)).

I was trying to make this setup by using a set expression

Sum( { 1 < Date={ " >=\$(=AddMonths(Date,-3)) <\$(=AddMonths(Date,1)) " } > } if(Value='A',1,0) )

The Graph works for the date, it show only the period that I need. But when I make a subselection of Categories, it keeps showing the full result, so all possible Categories.

I tried removing the leading 1 but that only shows the current selected month.

Any Ideas ? Maybe the setup that I have in mind needs another approach...

P

• Need some help with set_expressions !!

In my real app I have two Categories Cat1 and Cat2... Don't know if that matters...

• Re: Need some help with set_expressions !!

Hi,

Not sure my understanding is correct, Try this below expression and check.

- Sridhar

• Need some help with set_expressions !!

Thanks for your answer, but unfortunately that didn't realy fullfil my needs...

I want to select 1 Index date, that has to be seen in the graph as a period of that month and 3 preceding months. I managed to do that with the set expression I mentioned before but it overrules the Category selection too. It should only overrule the Date selection to show a period of 4 months instead of the selected month.

In the graph I see full set of Categories, no matter the selection...

• Re: Need some help with set_expressions !!

Thought of something like ...

sum({\$<[Cat1]=,

[Cat2]=,

[IndexDate]={">=\$(var3MonthsAgo) <\$(varNextMonth)"}>}

If(Value='G',1,0))

But now I only see 1 month, the selected Month, not the timespan...

In this setup I would need the IndexDate calculation be done on the total dataset...

• Re: Need some help with set_expressions !!

I needed a date island...