Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
d4rlie891
Contributor III
Contributor III

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 :

Tot Per Group.jpg

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

1 Solution

Accepted Solutions
sunny_talwar

May be this:

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

View solution in original post

17 Replies
florentina_doga
Partner - Creator III
Partner - Creator III

try this

sum(aggr(tot_trans,grup,yaer_month))

/

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

sunny_talwar

May be this:

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

d4rlie891
Contributor III
Contributor III
Author

HI,

the query it's not working.

Thanks

d4rlie891
Contributor III
Contributor III
Author

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

Anonymous
Not applicable

Hi,

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

Regards!!

sunny_talwar

Did you try what I proposed?

sunny_talwar

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)

d4rlie891
Contributor III
Contributor III
Author

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

Tren %.jpg

After select a Year_month:Tren2 %.jpg

Thanks For Your Help

sunny_talwar

How about this:

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?