Jump to content
  • 0

Trouble with Task - need to apply a WHERE to a variable but cant seem to


roattw

Question

Basic table counting 1) how many cases an MD has over a week and 2) how many of those cases were "treated"

I want to run a task to send an email with summary tables.  Works well but I cant seem to combine them into one summary variable/table.  I have to do them independently.  But the counting of treated requires an additional "Where" filtering that I cant figure out how to apply.

Below are the two tables generated and emailed:  "MD No of Cases"  and "MD cases Treated"  .   I would like to somehow combine variables A and B and have just one variable reported as in the last image.

 caspiotask1.thumb.jpg.f0c80cc50a066af32520297aa4897663.jpg

 

PREFERRED:

caspiotask2.jpg.5f66090f57b325cd2d56755b0d04d5de.jpg

 

AS always, your people are my heroes.

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @roattw,

I used the following approach (not sure that it is optimal): I used 2 variables similar to your example and added an empty 'Treats' field which is populated by a loop. 

Please note that I used Left join in the 'Update' block because not all the 'MD' will have 'Treated contains Yes'. So, the Inner join can skip some 'MDs'.

BddpjcV.png

 

Tested on the following data set:

lhhHXyF.png

 

Here is the result:

vgOupSL.png

Link to comment
Share on other sites

  • 0

Man, I appreciate your help so much.  That worked.  Can we Venmo you funds when you help so much?  Final solution in case someone else can use it.  Last thing I could use for it is to be able to add the date range to the email body.  Have the Difference between UTC run timestamp - 7 days date so the email would read:

Report from "DATE1 (UTC Timestamp - 7 days)"  to  "DATE2  (Report timestamp)"

Tried to make a new variable to receive report timestamp and another to receive timestamp - 7 days, but failed first attempt.  Couldnt find a "date minus" function.

caspo_task_complete.thumb.png.84224df01ca320d774db1aa939773770.png

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...