# App Development

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
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)

• ### Set Analisys

1 Solution

Accepted Solutions
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

3 Replies
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
Creator II
Author

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

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

Tags
Community Browser