Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ugurarslan
Creator
Creator

Current month YYYYMM convert to Prior Month YYYYMM

Dear all,

a very simple question where I struggle already for a few days.

For the current invoice month I use [Invoice Year Month]={'$Current_Month_YYYYMM)'}.

Question, how can I get prior month or two months prior?

I tried [Invoice Year Month]={'$Current_Month_YYYYMM)',-2}. but it doesn't work.

Please help me.

Ugur

6 Replies
agigliotti
Partner - Champion
Partner - Champion

how does "Invoice Year Month" field looks like ? is a text or number ?

ugurarslan
Creator
Creator
Author

the result for current month would be 201809.

Ivan_Bozov
Luminary
Luminary

Maybe try like this: [Invoice Year Month]={"$(=AddMonths(Current_Month_YYYYMM, -1))"}

vizmind.eu
sunilkumarqv
Specialist II
Specialist II

if field Current_Month_YYYYMM format would ne '201809' below should works


[Invoice Year Month]={"$(=(Current_Month_YYYYMM ) -1)"} - for previous month

[Invoice Year Month]={"$(=(Current_Month_YYYYMM) - 2)"} - for previous to previous month

agigliotti
Partner - Champion
Partner - Champion

maybe this:

[Invoice Date] = {">=MonthStart(AddMonths(Today(), -1))<=MonthEnd(AddMonths(Today(), -1))"}   prior month

[Invoice Date] = {">=MonthStart(AddMonths(Today(), -2))<=MonthEnd(AddMonths(Today(), -2))"}   two months prior

I hope it helps.

OmarBenSalem

Try this:

[Invoice Year Month]={"$(=date(monthstart(addmonths(today(),-1)),'MMYYYY'))"}