Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hamzabob1
Partner - Contributor III
Partner - Contributor III

To find unique charges based on ID,REGION.

Hello all,

I have one problem can u please help me out.

IDTRANSACTION NOREGION TAXVALUE
B1T1ABC50100
B1T2ABC50200
B1T3ABC50250
B2T4XYZ25500
B2T5XYZ25750
B3T6PQR

30

200
B3T7PQR30350

I need to calculate sum of VALUE w.r.t ID.

EX:  ID = B1

       VALUE = 550

As per the scenario the TAX will become 150, where as I need to consider it as unique(i.e., only 50 because my ID is B1 only)

so the final result should display as follows

________________________

ID: B1

Transaction count: 3

Region: ABC

TAX: 50

VALUE: 550

___________________________And also require Region wise as below

Region: ABC

TAX: 50

VALUE: 550

Region: XYZ

TAX: 25

Value:1250

_____________________________

Thanks in advance

18 Replies
hamzabob1
Partner - Contributor III
Partner - Contributor III
Author

IDTRANSACTION NOREGIONTAXVALUE
B1T1ABC50100
B1T2ABC50200
B1T3ABC50250
B2T4XYZ25500
B2T5XYZ25750
B3T6PQR

30

200
B3T7PQR30350
B4T8PQ30300
B4T9PQ30350

Above is my new table now.and my expected output is:

sum(TAX)=135

kavita25
Partner - Specialist
Partner - Specialist

You want this with addition to the above result?? or what??

Anonymous
Not applicable

Hi ,

Please elaborate what is the logic for sum(Tax) = 135 ??

sunny_talwar

Try this in a text box object:

=Sum(Aggr(Avg(TAX), ID))

hamzabob1
Partner - Contributor III
Partner - Contributor III
Author

SUM(TAX)(50+25+30+30)=135

kavita25
Partner - Specialist
Partner - Specialist

Try this expression:

=sum(aggr(sum(distinct TAX),ID))

sunny_talwar

See the attached QVW:

Capture.PNG

hamzabob1
Partner - Contributor III
Partner - Contributor III
Author

Thank you Sunny & Kavita that is wat i am looking for..

thanks again

Not applicable

In straight table:

Dimension : ID,REGION,TAX

Expression1:  Aggr(Count([TRANSACTION NO]),REGION)

Expression 2: Aggr(DISTINCT Sum(VALUE),REGION)