17 Replies Latest reply: Aug 23, 2016 7:46 AM by Sunny Talwar

# How to Get Total TRX per Group per Month

Hi,

Anyone can help me how to get the Percentage of Trx per Group per Month.

I have the data like this :

Sample : on 2016-07, I want to get the percentage of transaction of Group A, which is :

134.643.024 / (134.643.024 + 11.525.219 + 43.606.870 + 129.553.126 + 58.131.741)

Thanks

• ###### Re: How to Get Total TRX per Group per Month

try this

sum(aggr(tot_trans,grup,yaer_month))

/

sum(total aggr(tot_trans,grup,yaer_month))

• ###### Re: How to Get Total TRX per Group per Month

HI,

the query it's not working.

Thanks

• ###### Re: How to Get Total TRX per Group per Month

Did you try what I proposed?

• ###### Re: How to Get Total TRX per Group per Month

May be this:

Sum(TOT_TRANS)/Sum(TOTAL <YEAR_MONTH> TOT_TRANS)

• ###### Re: How to Get Total TRX per Group per Month

Hi Sunny,

It's Work.

Could you tell me please, How If I want to show the data on a line Chart?

I want the line Chart is Fixed and I want to show 12 months data.

My set Analysis is like this, and the Chart still change when I select a Year_Month :

sum(

{<YEAR_MONTH = {">=\$(=date(addmonths(max({1}YEAR_MONTH), -12), 'YYYY-MM'))"} * {"<=\$(=max({1}YEAR_MONTH))"}>}

TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> TOT_TRANS)

Thanks a lot

• ###### Re: How to Get Total TRX per Group per Month

May be you need to ignore YEAR_MONTH is the denominator as well:

Sum({<YEAR_MONTH = {">=\$(=date(addmonths(max({1}YEAR_MONTH), -12), 'YYYY-MM'))"} * {"<=\$(=max({1}YEAR_MONTH))"}>} TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> {<YEAR_MONTH >} TOT_TRANS)

• ###### Re: How to Get Total TRX per Group per Month

Hi Sunny,

The line Chart still change when I select the Year_Month.

If I select 2016-06, I want to have a line chart from 2015-06 - 2016-06

Before Selection

After select a Year_month:

• ###### Re: How to Get Total TRX per Group per Month

Sum({1<YEAR_MONTH = {">=\$(=Date(AddMonths(Max({1}YEAR_MONTH), -12), 'YYYY-MM'))<=\$(=Max({1}YEAR_MONTH))"}>} TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> {1} TOT_TRANS)

If it still doesn't work, would you be able to share a sample?

• ###### Re: How to Get Total TRX per Group per Month

Hi Sunny,

With This Set Analysis, it Freeze everything.

I need to be able to select Group and still have trend of 12 Months.

For Example : if I select Year_month 2016-03, it will show trend from 2015-05 to 2016-03.

I attach the Qvf file.

Thanks A lot for your help. !

• ###### Re: How to Get Total TRX per Group per Month

This seems to be working, isn't it?

Sum({<YEAR_MONTH = {">=\$(=Date(AddMonths(Max({1}YEAR_MONTH), -12), 'YYYY-MM'))<=\$(=Max({1}YEAR_MONTH))"}>} TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> {<YEAR_MONTH>} TOT_TRANS)

• ###### Re: How to Get Total TRX per Group per Month

Hi Sunny,

That Set Analysis is almost perfect.

But This Line Chart is keep showing the Data from 2015-08 to 2016-08.

What I need is, if I select Year_month 2016-06, this Line Chart will show the Data from 2015-06 to 2016-06.

• ###### Re: How to Get Total TRX per Group per Month

Then you need to remove the {1} here:

Sum({<YEAR_MONTH = {">=\$(=Date(AddMonths(Max({1}YEAR_MONTH), -12), 'YYYY-MM'))<=\$(=Max({1}YEAR_MONTH))"}>} TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> {<YEAR_MONTH>} TOT_TRANS)

and use this:

Sum({<YEAR_MONTH = {">=\$(=Date(AddMonths(Max(YEAR_MONTH), -12), 'YYYY-MM'))<=\$(=Max(YEAR_MONTH))"}>} TOT_TRANS)

/

Sum(TOTAL <YEAR_MONTH> {<YEAR_MONTH>} TOT_TRANS)

• ###### Re: How to Get Total TRX per Group per Month

Hahahaha how can you Thanks So Much be a helpful response bro? Please mark those responses as helpful which helped you and which have a potential of helping others in the future.

Best,

Sunny

• ###### Re: How to Get Total TRX per Group per Month

Hi,

Sum(TOT_TRANS) / SUM( TOTAL <grup,year_month> TOT_TRANS)

Regards!!