Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a requirement that
county, session ID , start date, finish date,
now i have to calculate session id count for each country based on both ( start date, finish date,)
eg: in below table required, country and count (session ID) which is having both start date and end date.
we can say like "Number of SUCCESSFUL sessions ( successful means the id which is having finish date also)
session ID | country | start date | finish date |
aaaaa | ind | 2023-01-01T11:21:03Z | 2023-01-01T11:34:38Z |
ssssss | us | 2023-01-05T17:20:33Z | |
ddfd | ind | 2023-01-04T00:35:11Z | 2023-01-04T00:42:21Z |
wwww | uk | 2023-01-03T11:23:28Z |
Create a flag field during data reload in the Data Load Editor as below
Load
SessionID
,Country
,StartDate
,EndDate
,if(len(StartDate) and len(EndDate),1,0) as flag_session
From XyzSource;
Then use expression
=Count({<flag_session={1}>}Distinct SessionId)
OR if you are unable to create a field, try below
=Count({<SessionId={"=len(StartDate)>0 AND len(EndDate)>0"}>}Distinct SessionId)
Create a flag field during data reload in the Data Load Editor as below
Load
SessionID
,Country
,StartDate
,EndDate
,if(len(StartDate) and len(EndDate),1,0) as flag_session
From XyzSource;
Then use expression
=Count({<flag_session={1}>}Distinct SessionId)
OR if you are unable to create a field, try below
=Count({<SessionId={"=len(StartDate)>0 AND len(EndDate)>0"}>}Distinct SessionId)
thank you it worked i have given in expression of session ID