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

select dynamic input for a graph

Hello All,

I have a table containing transaction data for multiple quarters (which can be identified by a transaction date associate with it). I want to create a graph comparing any 2 quarters in the data but I want to give user a choice to select the quarters to compare may be using radio buttons. How do I go about this? I couldn't find an example which will help me to implement such a functionality.

Thanks

16 Replies
Not applicable
Author

so the table has data worth multiple years and I want the user to be able to select any 2 quarters for comparison (i.e. any 2 quarters from any 2 years). So I have 4 drop-down input boxes containing pre definied  values of years and quarters. User can then select year and quarters respectively and the graph will update according to user's selection. Does that make sense?

sunny_talwar

Try this:

=Sum({<Year = {'$(vYear1)'}>}{<Quarter = {'$(vQuarter1)'}>}MValue) - Sum({<Year = {'$(vYear2)'}>}{<Quarter = {'$(vQuarter2)'}>}MValue)

Not applicable
Author

oh, that is exactly what I did but didn't realize I had quarter = year in the previous post, forgot to update that while posting!

sunny_talwar

Ya that should work in theory for a comparison such as:

Year = 2015 Quarter = Q1 vs Year=2014 Quarter= Q1 or

Year = 2015 Quarter = Q2 vs Year=2015 Quarter= Q1


If this is the kind of comparison you are looking for, then this should def. work.

Best,

Sunny

Not applicable
Author

Set expression definitely worked here and I have slightly modified the code so that I have one field 'YearQuarter' instead of 2 fields year and quarter. So the updated set expression looks like this

=Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue)


Now I want to include a filter (slider object) to filter values on X axis i.e. my slider should read min(above expression) to Max(above expression) but when I try to use min and max on the above expression I get garbage value error. Am I missing something here? Could someone please help me with this issue?

thanks!

sunny_talwar

I feel that since this is a new question that you are asking why don't you start a new thread with an example??? It would be probably easier for people to see the issue at hand and you can always give a link to this thread if they want to see more details.

Just a thought

Best,

Sunny

Not applicable
Author

I am actually creating a new thread as well but wanted to post here since this thread has more background information.