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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anat
Master
Master

sum of values based on selection match

Team,

i have data like

                      

110
1220
12130
12340
121250
123160

my requirement is :

scenario 1) suppose if i select 1(1* means all records are starting with 1) then result is 10+20+30+40+50+60=210

scenario 2) suppose if i select 12(12* means which all records starting with 12) then result is 20+30+40+50+60=220

scenario 3) if i select 121 (121* means which all records starting with 121) then result is 30+50=80 ........

how to implement these logic?

Regards

..............

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

Do you want this just to be a value?

If so:

=Sum({<Record={'$(=Record)*'}>}Value)

in a text box would do. Where Record is your first column, Value is your second. Making selections in your field Record would then give you the resulting summed value.

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add the first field to a list box. Click on the magnifying glass icon and enter 12* in the search field and press enter. You have now selected the values starting with 12*. Now add a text box with =sum(FieldName2) as expression. Replace FieldName2 with the name of your second field. You will get the result 200. Because 20+30+40+50+60 = 200 and not 220. See attached qvw.


talk is cheap, supply exceeds demand
morganaaron
Specialist
Specialist

Do you want this just to be a value?

If so:

=Sum({<Record={'$(=Record)*'}>}Value)

in a text box would do. Where Record is your first column, Value is your second. Making selections in your field Record would then give you the resulting summed value.

Not applicable

Hi

Please have a look this one.

Thanks

anat
Master
Master
Author

thanks gwassenaar & morganaaron ,both scenarios are working for my requirement ,thanks................