Contributor

## Comparison (calculate a difference) of two selectable parameters

Hi, Anaplaners

I am expecting to compare two parameters (in the attached file, May vs April) which users can select. (Please see the attached file). I would like your pointers on how to acheive this. April, May, and Jun do not have to be TIME dimension, but may be a list.

Regards,

Greg

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Contributor

## Re: Comparison (calculate a difference) of two selectable parameters

Hi Greg,

It can be achieved in the following way:

1) Create a module e.g, "comparison" with 2 line items as shown below, and format the line items as Months list

2) In your Raw data module create following line items:

Data = Line item where your data is sitting (Your existing line item)

Filter A = Boolean line item, which will check the month which is selected as parameter A

[Formula: ITEM(Months List) = Comparision.Parameter A]

Filter B =  Boolean line item, which will check the month which is selected as parameter B

[Formula: ITEM(Months List) = Comparision.Parameter B]

Stage Data A = Holds the data for Parameter A [Formula: IF Filter A THEN Data ELSE 0]

Stage Data B = Holds the data for Parameter B [Formula: IF Filter B THEN Data ELSE 0]

3) Create a Reporting module with only Region and Product as dimensions and with 1 line item as "Data"

Write the formula as = "Raw Data.Stage Data A - Raw Data.Stage Data B"

The values in this module change dynamically when the parameters are changed in 1st module.

Publish 1st module and 3rd module into Dashboard.

It will work as expected. Let me know, if you need further clarification on this.

Hope this helps.

Regards,

CA Pavan Kumar

5 REPLIES 5
Regular Contributor

## Re: Comparison (calculate a difference) of two selectable parameters

Hi Greg,

It can be achieved in the following way:

1) Create a module e.g, "comparison" with 2 line items as shown below, and format the line items as Months list

2) In your Raw data module create following line items:

Data = Line item where your data is sitting (Your existing line item)

Filter A = Boolean line item, which will check the month which is selected as parameter A

[Formula: ITEM(Months List) = Comparision.Parameter A]

Filter B =  Boolean line item, which will check the month which is selected as parameter B

[Formula: ITEM(Months List) = Comparision.Parameter B]

Stage Data A = Holds the data for Parameter A [Formula: IF Filter A THEN Data ELSE 0]

Stage Data B = Holds the data for Parameter B [Formula: IF Filter B THEN Data ELSE 0]

3) Create a Reporting module with only Region and Product as dimensions and with 1 line item as "Data"

Write the formula as = "Raw Data.Stage Data A - Raw Data.Stage Data B"

The values in this module change dynamically when the parameters are changed in 1st module.

Publish 1st module and 3rd module into Dashboard.

It will work as expected. Let me know, if you need further clarification on this.

Hope this helps.

Regards,

CA Pavan Kumar

Contributor

## Re: Comparison (calculate a difference) of two selectable parameters

Hi, Pavan

Thank you, Pavan. What you have suggested perfectly worked for me !!!

Regular Contributor

Cheers!

Pavan
New Contributor

## Re: Comparison (calculate a difference) of two selectable parameters

A follow-up question on that. I understand how the Comparison Module information is being extracted to Report Module. But are there any ways to combine the Comaprison Module and Report Module so that I can change the month I want directly in the Report Module instead of drilling down to Comparison Module and make changes there?

Regular Contributor

## Re: Comparison (calculate a difference) of two selectable parameters

Yes, you can do so. And, those line items does't require any dimensions.

Regards,
Pavan