Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

5 Replies
Not applicable
Author

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
Author

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
Author

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
Author

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_Michaelides
Luminary Alumni
Luminary Alumni

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