Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
juan_patrick
Creator
Creator

Sum, aggr and total

Hi everyone!

I have the next data:

type  transactions  client      type2

1           3              name1     123

2           4              name2     234

3          11              name3     345

1           4               name4    133

......

There are a lot of types.

I create a pivot table with the dimension type and, for each one, i created a calculated dimension:

=IF(

      aggr(

             rank(

                    SUM(

                             {<

                                 type2 = {'1*'}

                              >}

                              transactions

                            )

                     ),type, client) <= 10,

  client)

this bring to me the top ten client with the maximun transactions (in the expression I sum the transactions where type2 = {'1*'})

This is ok, but, i need another expression that sum all the transactions grouped by type (for the example data for the type 1 the sum is 7), i try with aggr, sum and total but it doesnt work.

Thanks a lot!!

Upload example!

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Aggr(NODISTINCT Sum({<type2 = {'1*'}>} transactions), type)


Capture.PNG

View solution in original post

10 Replies
Anil_Babu_Samineni

What is the expected O/P from given table

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
juan_patrick
Creator
Creator
Author

TYPE   TOTAL TRX

1               7

2               0

3               0

effinty2112
Master
Master

Hi Juan,

                    Have you tried

Sum(TOTAL <type> transactions) ?

EDIT :Sum({$<type2 = {'1*'}>}TOTAL <type> transactions)

Kind regards

Andrew

juan_patrick
Creator
Creator
Author

It give me back the total for each client, not for each type

juan_patrick
Creator
Creator
Author

It doesnt work

sunny_talwar

I would have assumed effinty2112‌'s expression to have worked, would you be able to provide a sample to show where it isn't working for you?

NickHoff
Specialist
Specialist

AGGR(Sum({$<type2 = {'1*'}>}TOTAL transactions),Type)

juan_patrick
Creator
Creator
Author

it dosnt work, i need it in every row

sunny_talwar

May be this:

Aggr(NODISTINCT Sum({<type2 = {'1*'}>} transactions), type)


Capture.PNG