Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
lostSquirrel112
Contributor II
Contributor II

Formula not working within set expression

I have a dataset of how long customers of a certain segment were active with our company as follows...

Customer AgeMonths
A 17
B 29
C 39
D 40
E 47
F 47
G 48
H 49

 

I'm trying to get the percentage  remaining  after each month, but I'm not even able to calculate the remaining customers in each month let alone the percentage of the total using the following formula in a chart...

"customers Remaining"

Count(DISTINCT TOTAL {<cohort={'2018-B_Group'}, AgeMonths = {">=$(=RowNo()-1)"}>} [Customer ID])

 

But my table just returns the total number of customers and disregards the age evaluation formula in the expression as seen below...

Screen Shot 2022-03-03 at 10.42.52 PM.png

Starting in month 18 I would expect to see 7 customers since customer A drops off but instead it still shows 8.

 

How can I show the remaining customers by month? Even better would be to show the percentage of all 8 remaining in each month because I have multiple segments I want to graph against each other.

 

Any help that can be provided would be greatly appreciated.

 

 

Labels (4)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Both set analysis and dollar expansions (the "$(=RowNo()-1)") are evaluated BEFORE the chart is expanded, resulting in one global value. So you cannot use this to create something that should be calculated row-by-row.

Take a look at the Above() function. This can be used to calculate something that is based on the above row.

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Both set analysis and dollar expansions (the "$(=RowNo()-1)") are evaluated BEFORE the chart is expanded, resulting in one global value. So you cannot use this to create something that should be calculated row-by-row.

Take a look at the Above() function. This can be used to calculate something that is based on the above row.

lostSquirrel112
Contributor II
Contributor II
Author

Thanks Henric, Above took care of it!