Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on adding sumif equivalent columns to data table in script

Hi everyone,

I have a data table below:

CustomerProductMonthYearDurationAgeGender
1234501032016150F
2346501032016240M
1265401032016450F
1354602032016520F
1654402032016745M

I want to calculate number and percentages of customers based on issue month/year and duration.

For example:

5 customer bought products in 3/2016 that has duration of 1 or longer

3 customer bought products in 3/2016 that has duration of 4 or longer

3 out of 5 customers with durations 4 or longer  = 60%

As duration increase, percentages should decrease.

Durationcountpercentage
15100%
24

80%

3360%
4360%

I try using duration as dimension and calculate the percentages in expression. But since denominator is calculated using all duration, it doesn't work..

I'm really new at this, any help would be great!!!

Thanks!

1 Reply
sunny_talwar

May be like this for denominator:

Count(DISTINCT TOTAL Customer)

or

Count(DISTINCT TOTAL <Month, Year> Customer)