Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
antonaks
Creator II
Creator II

Change to Set Analysis

Hello colleagues, 

Please, give me advice how, can I change this IF expression for set analysis analog?

if ((Date(last_date) - Date(date)) > 30, Count(distinct user_id),0)

 

Labels (2)
1 Solution

Accepted Solutions
kashyap
Partner
Partner

Hi

 Maybe you can create the day's difference in the back end

Date(last_date) - Date(date) as DateDiff

you can use this expression in the front end

Count({<Days={">=30"}>}OrderID)

You can use directly in expression but it should be KPI and dates should be filtered

Count(distinct  {<$(=Fabs(max(last_date) - max(date)))={">=30"}>}user_id)

Hope this info helps

Thanks

View solution in original post

3 Replies
jonathandienst
Partner
Partner

Set analysis is a filter, not a conditional. Therefore you can't replace that If with a set expression.

If you meant Count(If(....)), then you could use a set expression, but that is very different (with a different result) to what you posted.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
antonaks
Creator II
Creator II
Author

I'm sorry. Yes I mean  Count(If(....)) expression. 

kashyap
Partner
Partner

Hi

 Maybe you can create the day's difference in the back end

Date(last_date) - Date(date) as DateDiff

you can use this expression in the front end

Count({<Days={">=30"}>}OrderID)

You can use directly in expression but it should be KPI and dates should be filtered

Count(distinct  {<$(=Fabs(max(last_date) - max(date)))={">=30"}>}user_id)

Hope this info helps

Thanks

View solution in original post