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: 
confused-pandas
Contributor II
Contributor II

Heatmap divide values by left most column

Hi,

I made a heatmap of user retention per day. In the heatmap below, the values on each of the tile is the number of users that were active X days (dimension on top) following the creation of their account (dimension on the left). 

Instead of the actual number, I would like a percentage. The proportion of the users that were created on a specific day, that are still active X days following that day.

confusedpandas_1-1637594605419.png

It seems simple but I've tried couple of things and it just does not work.

1 Solution

Accepted Solutions
Or
MVP
MVP

That doesn't really change the solution, though, if I understand the data structure correctly (each user ID will repeat twice - once at 0 days and once at e.g. 7 days?)

count({<userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

/

count(total <userCreationDate> {<userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

should be the formula, I believe. Without access to the data and since this kind of an unusual data structure, I can't actually test it.

For the second part of the formula, you might also be able to use:

count( {<nbDaysSinceCreation = {0}, userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

View solution in original post

4 Replies
Or
MVP
MVP

Hard to say without seeing the data structure and the formulas used, but if the formula used is something like count(Users), then the percentage should be count(Users) / Count(total <Date> Users)

confused-pandas
Contributor II
Contributor II
Author

Thanks for your answer. I've already tried and unfortunately it divides by the total number of users. What I want instead is that, if we look at  the screenshot above, 10 users were active 7 days after the 23/10/2021 (date of account creation). Since 200 users were created on that day (left most cell), percentage should be 10/200 = 5% on that cell.

 

Formulas are:

Dimension A: userCreationDate
Dimension B: nbDaysSinceCreation

Measure: count({<userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId) 

Or
MVP
MVP

That doesn't really change the solution, though, if I understand the data structure correctly (each user ID will repeat twice - once at 0 days and once at e.g. 7 days?)

count({<userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

/

count(total <userCreationDate> {<userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

should be the formula, I believe. Without access to the data and since this kind of an unusual data structure, I can't actually test it.

For the second part of the formula, you might also be able to use:

count( {<nbDaysSinceCreation = {0}, userCreationDate= {"$(='>='&Date(Today()-30))"}>} DISTINCT userId)

confused-pandas
Contributor II
Contributor II
Author

This worked! Thank you Or, you are amazing! 🙂