Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

baarathi
Contributor

set analysis

Have a scenario such that, I want calculate the count(user) with restrictions such that, if the user comes to same place twice in a day the count of visit is 1, also if the user visit in two different cities in same day, the visit count is 1.

4 Replies

Re: set analysis

Maybe use an expression something like

     If ( Count(UserID) > 1 , 1 , 0 )

baarathi
Contributor

Re: set analysis

This is not working.

ChennaiahNallani
Contributor III

Re: set analysis

try like this

Table1:

LOAD

    ID,

    "UserID",

    Name,

    Date(ComeDate),

    City,

    Dnumber,

    CityID,

     if(CityID = CityID and ComeDate = ComeDate,1,

    if(CityID <> CityID and ComeDate = ComeDate,1,0)) as CountVisits

FROM [lib://cc/Sample45.xlsx]

(ooxml, embedded labels, table is Sheet1);

Table2:

LOAD

    IID,

    "UserID",

    "Type",

    Type2,

    "Class"

FROM [lib://cc/Sample45.xlsx]

(ooxml, embedded labels, table is Sheet2);

agigliotti
Honored Contributor II

Re: set analysis

maybe this:

count( distinct UserID+ComeDate )