Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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...
Thanks in advance !
P
I needed a date island...
In my real app I have two Categories Cat1 and Cat2... Don't know if that matters...
Hi,
Not sure my understanding is correct, Try this below expression and check.
Sum({< Date *={ ">=$(=AddMonths(Date,-3)) <$(=AddMonths(Date,1)) " },Value *={'A'} > } 1)
- Sridhar
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...
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...
I needed a date island...