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: 
sifatnabil
Specialist
Specialist

Any peek-like function in chart or expression?

Hi,

I have a chart that counts distinct users logging in over time. How can I have a text box/table/chart where it shows only new users logging in? i.e. were not logged in in the previous month. e.g. if 10 new users logged in in September, where new is defined as did not ever log in before (or did not log in the previous month), the chart should show 10 for September, instead of 1000 (total unique users in the month).

16 Replies
sifatnabil
Specialist
Specialist
Author

Hi tresesco, sunindia, SasiParupudi1

I just tried this on my real data but it doesn't seem to work. I used tresesco's concat to see the actual usernames coming up, and I immediately spotted Users A and B showing up under different months.

 

FebJanOct
AAB
BDE
FGH

I used this formula:

concat( {<Username={"=Count(Username)=1"}>} Distinct 

Username,'; ')

Any ideas why this might not work?

tresesco
MVP
MVP

PFA

sifatnabil
Specialist
Specialist
Author

Found the issue. It was due to an association with another table based on Username. Getting rid of that association made it work. Thanks all!

sifatnabil
Specialist
Specialist
Author

Darn, I think this doesn't actually give the end result that I want. For example let's say there's a new user logging in in February, and then he next logs in in May. I would want to count him as a new user in Feb, but this logic wouldn't count him! Since in the set analysis, it's scanning *all* months, and since his count in Feb+May=2, he's not a new user in Feb (but in reality, he is a new user up until Feb!).

What the logic should be is, the user should be counted as new only if he hasn't logged in for only previous months. Could the expression be amended to get this? tresescosunindiaSasiParupudi1

tresesco
MVP
MVP

It's probably not impossible in chart. But possibility surely going to take you to a much complex expression.  therefore, better to handle such situations in the script itself. Compare it and flag. Then in the front end use the flag to find new users.

sifatnabil
Specialist
Specialist
Author

Hi guys, I tried using above function like this:

count(distinct {<Username={"=above(count(Username),1,rowno())=0"}>}

But this returns no data. My preferred logic would be that above() will evaluate ALL previous rows, instead of just the 1 above it. Any ideas on how to make it work? tresescoSasiParupudi1Gabsus04sunindia

sifatnabil
Specialist
Specialist
Author

You're right - looks like this is the only way to do it simply. Full solution provided here: Count if value does not exist in all previous rows