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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
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
MVP
MVP

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
MVP
MVP

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.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
OmarBenSalem
Partner - Champion II
Partner - Champion II

Try this:

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