Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am new to Qlik sense, I am working with a measure
if(interval(today(2)-daystart(max({<[Session Count] = {1}>} LogTimeStamp)),'d')>45, null())
The expected result is if days more than 45 then return number of days since last accessed app, else null. The problem is this returns all nulls even when the number of days are more than 45, see screenshot below.
Try with Now(2) instead of Today(2) since you're working with a timestamp.
Hi @BrunPierre ,
I tried it, still get the same result. I also tried few things, I created a measure to calculate the number of days since last accessed (master measure and named it "Last accessed session"
interval(today(2)-daystart(max({<[Session Count] = {1}>} LogTimeStamp)),'d')
Then created another measure =if([Last accessed session] >= 45, 1, 0), I get all 0
The problem is the with the Days since last accessed? it is formatted as integer so not sure why it returns all zeros
please post some sample data for all relevant fields and your expected result.
if(interval(Today(2)-TimeStamp(max({<[Session Count] = {1}>} LogTimeStamp)),'d')>45, null())
or as @MarcoWedel suggested.
Maybe not working because of the "45" ? Comparing dates with numbers doesn't always go well...
There is no else-branch specified which means returning NULL for it and therefore you query returned it: if(condition, null(), null())
- Marcus
@marcus_sommer To your point I tried this another way I described it in this thread, but reiterating it here,
I created a measure to calculate the number of days since last accessed (master measure and named it "Last accessed session" - interval(today(2)-daystart(max({<[Session Count] = {1}>} LogTimeStamp)),'d')
Then created another measure =if([Last accessed session] >= 45, 1, 0), I get all 0
The problem is with the Days since last accessed? it is formatted as integer so not sure why it returns all zeros so I tried to format it to Num() and also tried Ceil() I still get all zeros