Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to obtain data from exact date

I have an excel chart with dates and comments.

I need to create a chart within QlikView to let me know which comments were done one week before or after the today date.

Thanks!!

B.

Tags (4)
5 Replies
Not applicable

Re: How to obtain data from exact date

I'm not sure if this would work with a text field, but for numeric fields, I use a lot of flags.

So in your script,

First define a variable to be equal to the max date

then add this:

InWeekToDate(YourDate,VariableofMaxDate,0) * -1 as CurWTDFlag

This will assign a 0 to all records where the date is not within the current week and a 1 to those dates that are in the current week.

Then in your expression you can multiple your field by the flag, returning 0 if the field is outside of the current week. 

Not applicable

Re: How to obtain data from exact date

I'm not sure if this would work with a text field, but for numeric fields, I use a lot of flags.

So in your script,

First define a variable to be equal to the max date

then add this:

InWeekToDate(YourDate,VariableofMaxDate,0) * -1 as CurWTDFlag

This will assign a 0 to all records where the date is not within the current week and a 1 to those dates that are in the current week.

Then in your expression you can multiple your field by the flag, returning 0 if the field is outside of the current week. 

Not applicable

Re: How to obtain data from exact date

sampleqlikview.jpg

Hi! Many thanks for your rapid response, but i think i dont get it.

Look, attached is my chart from QV, it contains data and comments, all, but I need to be cappable to filter those comments from last week, or last month (all in)....does it make sense to you??

Regards,

B.

Not applicable

Re: How to obtain data from exact date

sampleqlikview.jpg

Hi! Many thanks for your rapid response, but i think i dont get it.

Look, attached is my chart from QV, it contains data and comments, all, but I need to be cappable to filter those comments from last week, or last month (all in)....does it make sense to you??

Regards,

B.

jason_michaelid
Honored Contributor II

Re: How to obtain data from exact date

See my post here:

http://community.qlik.com/message/256243#256243

It leverages code written by Rob Wunderlich to create a table of standard date ranges which links to your date field.  You can select anything then - This week, Last week, This Year, Last Quarter etc etc etc.

Hope this helps,

Jason

Community Browser