Qlik Community

Qlik Sense Cloud Discussions

salmaneskandari
New Contributor

How to create dimensions from several variables

I am calculating retention rates (i.e. how many users that registered for our service week 1 came back week 2, 3, 4, and so on).

So let´s say I have 3 variables:

- vUsers1WeekPostReg - Gives me the number of users that logged in 1 week after registration

- vUsers2WeekPostReg - Gives me the number of users that logged in 2 weeks after registration

- vUsers3WeekPostReg - Gives me the number of users that logged in 3 weeks after registration



Now, I want to plot a chart (staple or line) where I can see on the Y-axis the number of users, and on the X-axis the 3 different weeks:

- Week 1 after registration

- Week 2 after registration

- Week 3 after registration


I don´t know how to create this dimension in a good way.


I tried if(vUsers1WeekPostReg>0,'Week 1', if(vUsers2WeekPostReg>0,'Week 2', vUsers3WeekPostReg>0,'Week 3').


The problem with this approach is that some users can be active in several of the specified times. So if they are "captured" by the first if-statement, they are lost in the second.


How can I do this in the best way?


Best regards,

Salman