Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Function to get start dates and Past 12 months

Hi Friends Stuck with Date Functions,I Have a  Accounting Period Field with all Dates the Format is 0201406, 0201405, 2014050 2014060

Have written below script

Load

       [@28:30] as [Prod],

     [@31:40] as [Pol],

     [@41:46] as [Cert],

     [@47:56] as  [Claim],

     [@57:63] as [AccPrd],==>Date Formats differently need to get in common format of 'YYYYMM'

[@1:3]&[@57:63] as Key,

Date#(Left(Num([@57:63]),6),'YYYYMM') as [Accounting Period]==>YYYYMM'


My main problem is while writing Where  [Accounting Period]]>=$(vPrevious) and [Accounting Period]]<=$(vCurrent) and NOT Exists(Key) ;

Error:Garbage after statement,can any one help on this.

How to get Accounting Period as DDMMYYYY with make date function so that i can get 12 months of Data from QVD.

As Accounting Period contains YYYYMM while writing Logic getting Error can any one help on this to write Make date Functions on Accounting Period

4 Replies
Not applicable
Author

Accounting Period Has 'YYYYMM' Need to Get as 'DDYYYYMM' format where i can use Below condition

Getting Error can any one suggest on how to get 'DDYYYYMM'

My main problem is while writing Where  [Accounting Period]]>=$(vPrevious) and [Accounting Period]]<=$(vCurrent) and NOT Exists(Key) ;


Variables Used:

vCurrent=MonthEnd(MONTHSTART(TODAY())-1)

vPrevious=AddMonths(MONTHSTART(Today()),-13)


SergeyMak
Partner Ambassador
Partner Ambassador

Hi,

You can use string concatenation like

'01' & [AccPrd] AS Date, if you need to load as first day of the month


Regards,

Sergey

Regards,
Sergey
Not applicable
Author

Not Working for any calendar comparison of Between Statement

01201410(DDYYYYMM) to 20201211(DDYYYYMM)

But in My case I have only YYYYMM in Account Period How to make Account Period as DDYYYYMM format

Make Date (Account Period)

Can you help on this

SergeyMak
Partner Ambassador
Partner Ambassador

It would be faster if you post your app.

But probably you can do something like this:

Use Variables

vCurrent=Date(MonthEnd(MONTHSTART(TODAY())-1),'DDYYYYMM')

vPrevious=Date(AddMonths(MONTHSTART(Today()),-13),'DDYYYYMM')

And for AccPeriod:

Date(MakeDate(LEFT(AccPrd,4)),RIGHT(AccPrd, 2), 1,'DDYYYYMM')


Regards,

Sergey


Regards,
Sergey