Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Manni_SM
Creator
Creator

if condition not working

Hi All

am trying below if condition to get 

last 60  days session count 

last 90 days session count

last 180 days session count

used this but no luck 

 If(num(date(LogEntryPeriodStart))>=num(date(now()-60)), 'Last 60 days' ,

If(num(date(LogEntryPeriodStart))>=num(date(Today()-60)) and num(date(LogEntryPeriodStart))<=num(date(Today()-90)),

'Last 90 days', 'Last 180 days'))

 

any suggestions ? 
 

Labels (6)
1 Solution

Accepted Solutions
marcus_sommer

Each access to a field means to perform an aggregation - if none is explicitly specified the only() is implicitly applied - and only() will return NULL if there is more as single value available for the context of the call - therefore my suggestion to wrap the query with an aggr() with appropriate dimensionalities.

If any possible a query like: Date - today() should be done within the data-model and maybe also the entire evaluation of these results.

View solution in original post

1 Reply
marcus_sommer

Each access to a field means to perform an aggregation - if none is explicitly specified the only() is implicitly applied - and only() will return NULL if there is more as single value available for the context of the call - therefore my suggestion to wrap the query with an aggr() with appropriate dimensionalities.

If any possible a query like: Date - today() should be done within the data-model and maybe also the entire evaluation of these results.