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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exception query

I have the following tables linked

table.bmp

For this question, please ignore the Role and Businesses table

As you can see each activity entered by one of our salespeople is linked to a contact, which is linked to an account

I need to produce a straight table which shows me Accounts which have had no activities in the last month. How would i do this?

1 Solution

Accepted Solutions
Not applicable
Author

I've worked it out now, with a lot of help. This was the solution

If(count({$ <Activity.CalendarDate={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}, AccountTags.Name={'Tier 1'}>} Activities.AccountId)=0, 1,0)

View solution in original post

9 Replies
Not applicable
Author

Hi Alex

I'm sure there is a better solution, but this is the first which came to my mind:

Dimension: Accounts

Expression: If(COUNT(ActivityContactID) = 0, 1, 0)

Presentation => Supress Zero Values checked

Lukasz

Edit: you can extend with set analysis to take only the last month into consideration

Not applicable
Author

From your data model all the tables seem to be nicely assoicated. So on the front-end put acountsID and Activity.CalendarDate in a table box. Where ever there is a null() against Account ID then those don't have any activities.

Now in a straight table

Add AccountID as dimension

Expression something like: if(isnull(Acitivity.LastMonth),1,0)

Activity.lastMonth is a flag on back-end to find out the last month.

Hope it helps

Thanks

AJ

Not applicable
Author

Hi Ajay, this is very close but not quite right.

Last Month only literally gives me the last calendar month. It's my fault as I should have been clearer in my question, but I actually meant the last 30 days.

how would the expression differ, would it be something like this

if(isnull(Activity.DaysAgo<=30),1,0)

Not applicable
Author

I also need to apply to following set analysis to the table.

{$<AccountTags.Name={'tier 1'}>}

How would this fit into the expression?

Not applicable
Author

How would I extend this for the last 30 days?

Not applicable
Author

Is it possible to attach a sample doc with data source files as well.

If you want a general suggestion your data your data might look like this in a table box:

Account.AccountIDAccounts.CreatedDateActivity.CalendarDate
233/2/20143/3/2014
451/1/20141/3/2014
34512/30/20131/1/2014
21311/2/201312/4/2013
3459/2/201310/16/2013
23425/1/20135/1/2013
0922/27/2014
2341/2/2013
13223/1/2014

Now from this you can find out that the last three don't have a Activity date which means those IDs dont have any Activities but those would have Accts.CreatedDate.

In this case you want 092 and 1322 only as they are within last 30 days right?

So you can create a flag for last 30 days based on Accts.CreatedDate  as 1/0 and left join Activity.CalendarDate to Accounts table and create field like if(isnull(Activity.CalendarDate),1,0) on backend.

Now on front end your expression could be

Only({<Accounts.CreatedDateFlag={1},Activity.CalendarDateFlag={1},AccountTags.Name={'tier 1'}>}Account.AccountID)

Thanks

AJ

Not applicable
Author

Hi Ajay,

i've attached some data.

Essentially i need to return the Accounts.Name where AccountTags.Name is 'tier 1' and where there are no Activities.AccountID values for each Accounts.Name for the last 30 days

Not applicable
Author

Hey Alex,

The data you provided doesn't seem to have null Activities.AccountID for AccountTags.Name= 'tier 1' in the last 30 days.

So added two rows to the excel with the criteria you mentioned.I created a field called ReqField on the back-end which will give you values you are looking for.

Thanks

AJ

Not applicable
Author

I've worked it out now, with a lot of help. This was the solution

If(count({$ <Activity.CalendarDate={'>=$(=Date(Today()-30))<=$(=Date(Today()))'}, AccountTags.Name={'Tier 1'}>} Activities.AccountId)=0, 1,0)