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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
nina_le_06
Contributor
Contributor

aggregate values by field

Hi, 

I can't seem to figure out how I can Aggregate values for all values within one field that are the same. In my example I have customer IDs and Membership start and end Dates. I would like to calculate the Membership Duration per customer ID. 

Customer ID            Membership Duration       expected result: Duration.per member

5555                             364 days                                                      864 days

5555                             300 days                                                       864 days

5555                             200 days                                                      864 days  

5656                             30 days                                                         70 days

5656                             40 days                                                         70 days 

 

Now I would like to create a new field which sums up all values for the same customer ID, meaning 864 days for customer 5555 and 70 days for customer 5656 and so on. 

Can I do this as a Chart function instead of in the script? 

I would appreciate any help 🙂 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try this expression:

sum(total <[Customer ID]>[Membership Duration])

 

Vegar_0-1587121951349.png

 

See attached qvw

View solution in original post

1 Reply
Vegar
MVP
MVP

Try this expression:

sum(total <[Customer ID]>[Membership Duration])

 

Vegar_0-1587121951349.png

 

See attached qvw