×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using ApplySimple

Using ApplySimple

Using ApplySimple

(OP)
Is it possible for me to use the applysimple function to create an attribute that displays 'next week'? I am trying to use something like this: select week_dt+7 from weeks as NWK_WEEK_DT but I know I am missing something. DBA wants to get out of creating a MV for this. Any suggestions?  thanks!

RE: Using ApplySimple

Dear petperson,

If your are using Oracle as warehouse you can use Applysimple as follows:

ApplySimple("#0+7",columnname)

Here #0 is a placeholder where the columnname will come when the expression is evaluated. So 7 days will be added to the columnname (which is a date column).

If any other database is there then use the syntax that is legal in that database. But the placeholder(#0) should be there within the double quotes with plus 7, then comma and then the column name.

Try do this. It will definitely work.

Thanks.

User14

RE: Using ApplySimple

you probably don't need applysimple, just use "week_dt+7" as your id expression.

RE: Using ApplySimple

(OP)
Thanks for your responses. I was able to create an attribute using the applysimple function with Week_Dt. What I am really trying to do, is to use this Next Week attribute object in place of a transformation table so that I can apply this to a metric in order to return budget $ for next week. I am trying to create my dynamic date filter to use in the conditional metric. Do I still need to use today +7 in the attribute qualification?  I would think it would use the definition on the Next Week attribute I created in order to add the 7 days. I'm confused..does it show??

RE: Using ApplySimple

I think nlim's approach is the way to go...using applysimple complicates things...why reinvent the wheel when you have the functionality there already?

If you are working with budget concerns, you probably have base metrics (actual expenses, budgeted expenses) -- and their variants (variable, fixed).  

Your template probably looks something like this:

        ACTUAL    |   BUDGET
     ------------------------
DATE |

What you are really trying to do is change the 'Where' clause of the SQL to get a specific date range, i.e. Where date_id = getdate() + 7 -- which would imply expenses for next week.  What it comes down to is the filter, so the filter has to force date_id + 7, which isn't a big deal if you let a dynamic date filter do the work for you.  BTW, getdate() could be a fixed, prompted date that could reflect the end of a specific week.

Probably a more verbose answer than needed, but I think a little tinkering with dynamic dates would do you a lot of good.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close