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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Add total of straight table to another value

Hi,

I have a straight table

Country     Count     Amount    month

ABC          52          104               01

ccc              21          21               01

eee          60               120               01

ABC           70           140              02

ccc             5                  5            02

here i calculate Amount as below

if count < 50 , amount = count else amount = count * 2

So i get the total of this table = 390

now i need to add this 390 to another variable say y,

please tell me how to do that

Thanks

1 Solution

Accepted Solutions
kamalqlik
Partner - Specialist
Partner - Specialist

Hi Anuradha,

Please find updated QVW.

You can use in both ways,either by making variable or going directly

Regards

Kamal

View solution in original post

15 Replies
Not applicable

Hi,

Can u plz share the sample file.

felipe_dutra
Partner - Creator
Partner - Creator

=Sum(Count*If(Count<50, 1, 2))

Felipe

Not applicable

=$(your variable)+Sum(Amount*if(count<50,1,2))

SunilChauhan
Champion II
Champion II

see the attached file

Sunil Chauhan
anuradhaa
Partner - Creator II
Partner - Creator II
Author

This is my Table,

MonthCOUNTRYCOUNTAmount
Jun-72.11
MayA150.00
JunE6519.57
JunC7723.19
MayB830.00
JulE9328.29
JulA940.00
JunA1890.00
JulB2040.00
JunB4900.00
MayD1,399421.31
JulD6,6382,019.01
JunD23,7976,548.73
33,1519,062.20

So i have use counts to calculate Amount. I know how to do it. But the problem is i want to get Total Amount (9,062.20) and add that value to some another value,

Thanks

kamalqlik
Partner - Specialist
Partner - Specialist

Hi Anuradha ,

Where you want to add this value in same chart or somewhere else.

Regards

Kamal

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Same Chart

Not applicable

you cannot do that. Put a text box just below the chart, make it look like part of the  chart and use my expression.

anuradhaa
Partner - Creator II
Partner - Creator II
Author

This is waht i have in my straight table expression for amount

=Sum(if(COUNTRY='B',0,(if(Date#(AEI_MonthYear,'MMM-YY') <= date#('Jun-14','MMM-YY'),

((if((Sum(COUNT)<=130),(Sum(COUNT)*.15),if((Sum(COUNT)>130 and  Sum(COUNT)<=220),((Sum(COUNT)-130)*.033)+130,((Sum(COUNT)-220)*.041)+204)))*19.6) ,

((if((Sum(COUNT)<=130),(Sum(COUNT)*.101),if((Sum(COUNT)>130 and  Sum(COUNT)<=220),((Sum(COUNT)-130)*.053)+131,((Sum(COUNT)-220)*.0415)+206.2)))*19.6)))))

and i use below as variable,

=SUM(Aggr(Sum(if(COUNTRY='B',0,(if(Date#(AEI_MonthYear,'MMM-YY') <= date#('Jun-14','MMM-YY'),

((if((Sum(COUNT)<=130),(Sum(COUNT)*.15),if((Sum(COUNT)>130 and  Sum(COUNT)<=220),((Sum(COUNT)-130)*.033)+130,((Sum(COUNT)-220)*.041)+204)))*19.6) ,

((if((Sum(COUNT)<=130),(Sum(COUNT)*.101),if((Sum(COUNT)>130 and  Sum(COUNT)<=220),((Sum(COUNT)-130)*.053)+131,((Sum(COUNT)-220)*.0415)+206.2)))*19.6))))),Month,COUNTRY))

But that variable doesn't return the value