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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Between Date

hi All,

I'm looking for a solution to get rang of date.

For exemple, i've data between 01/01/2012 and 01/12/2012

knowing that the date day is 01/12/2012.

i'm looking to get all the dates between 01/01/2012 and 01/06/2012.

any idea ?????

Labels (1)
9 Replies
MayilVahanan
MVP
MVP

HI

Are you looking this

Let vEnd = Num(date(01/12/2012));

Let vStart = Num(date( 01/06/2012));

Generate:

LOAD Date($(vStart) + IterNo()) AS Date

AutoGenerate 1

While ($(vStart) + IterNo()) <= $(vEnd);

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

i'm trying to get the date in a field selection.

Anonymous
Not applicable
Author

to give you an idea about what im looking to do, i tried this :

if(MOIS_ENCAISS>=AddMonths(MOIS_ENCAISS,-12) and MOIS_ENCAISS>=AddMonths(MOIS_ENCAISS,-6),MOIS_ENCAISS)

MayilVahanan
MVP
MVP

Hi

Try like this

=sum({<Date = {'>=$(=vVar1)<=$(=vVar)'}>}Sales)

vVar1

=AddMonths(Date,-6)

vVar

=AddMonths(Date,0)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi you need the dates between the 2 dates are performing calculation for these dates?

Anonymous
Not applicable
Author

i gived up for this solution !!

now i created 2 variables, for exemple :

V1 = A

V2= F

i want to creat a macro how will select the data between V1=A & V2=F.

?????

Anonymous
Not applicable
Author

i did this code , and it works fine :

sub DataBetweenSelectedDate() 'Used with the Variables , it filter the reports for two selected dates

set FD = ActiveDocument.Variables("FromDate") '' variable for Initial date

FrmDtt=(FD.GetContent.String)

FrmDate=">=" & Day(FrmDtt) & "/" & month(FrmDtt) & "/" & year(FrmDtt)

set TD = ActiveDocument.Variables("ToDate") '' Varible for End Date

ToDtt=(TD.GetContent.String)

ToDate="<=" & Day(ToDtt) & "/" & month(ToDtt) & "/" & year(ToDtt)

ActiveDocument.Fields("CommonDate").Select FrmDate   &   ToDate '' CommonDate is field same to select between FrmDtt to ToDtt

end sub

MayilVahanan
MVP
MVP

HI

for this

FrmDate=">=" & Day(FrmDtt) & "/" & month(FrmDtt) & "/" & year(FrmDtt),

Try like this

FrmDate=">=" & Date(FrmDtt,'DD/MM/YYYY')

Hope this help

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Clever_Anjos
Support
Support

You don´t need a macro to this, (If you can do something without a macro, don´t use it at all)

Use 2 variables and a inputbox or slider to set these variables.

For example:

D1 and D2 are the variables.

So a Set Analysis like below returns what you need

sum({< YourDate={">=$(=D1)"}*{"<=$(=D2)"}>}Sales)

Note that I´m using the intersection operator "*" instead of >= D1 <= D2