Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey everyone,
I am new to Qlikview and now am struggling with a problem.
I have log file value such as:
UserID Component
1 a
1 a
1 b
2 a
2 a
3 a
3 c
3 d
What I would like to do is to count the number of distinct users who have only value "a" in component. In the case above, the number should be 1, since only UserID 2 only has value "a" component, without other value.
Does anyone know how could I write such a formula for counting?
Thanks a lot!
Try:
=count({<UserID = {"=only(Component)='a'"}>}distinct UserID)
Hope this helps!
Try:
=count({<UserID = {"=only(Component)='a'"}>}distinct UserID)
Hope this helps!
Hello,
You can achieve this with the following expression:
=Count({<UserID=E({1 <Component={"b", "c", "d"}>})>} DISTINCT UserID)
Please find attached the Only_A.qvw file as an example.
Regards,
Philippe
Hey Jeremiah,
it works! I really appreciate your help
Hey Phillippe,
thanks a lot for your help. Do you also agree that the solution provided by Jeremiah also works?
In the example I only named a few values in Component, if there are many more than those listed, would it not be so convenient to list all values except "a" in your formula?
Best regards,
Jun
I do agree
Thanks for the feedback Jun!
Regards,
Philippe