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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fanninam
Creator
Creator

If statement

Good Afternoon,

I'm wondering if anyone can help me with this.  I need to include an if statement that says if Month equals 1 then Month equals 13 and Year equals -1.

The reason for this is that headcount is pulled on the first day of the month for the previous month headcount.  For example, January 1st headcount number is the headcount number for December of the previous year.  I already have Month-1 to take care of all the other months.  The tricky part is always going to be January 1st.

12 Replies
fanninam
Creator
Creator
Author

Okay sorry.  I'm still learning several things.  I was able to attach the QVW.  Hopefully this helps.

juliedecoene
Partner - Contributor III
Partner - Contributor III

Hi Amber,

Can you try this?

Text(Date(AddMonths(MakeDate(Year, Month),-1),'MMM'))

MarcoWedel

Hi,

another solution might be:

QlikCommunity_Thread_248373_Pic1.JPG

HPU:

LOAD

    DEPT,

    Status,

    EjFTE,

    MonthName(Date#(Month&'/'&Year,'M/YYYY'),-1) as MonthName,

    Month(Date#(Month,'M')) as  Month,

    Year

FROM HCUpload.csv (txt, utf8, embedded labels, delimiter is ',', msq);

hope this helps

regards

Marco