Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Can you tell us your expected ouput and relevant fields you are using or share a sample app to quickly work on.?
This is the script. It is simple and pulling in monthly CSV files only. The only problem I have is the CSV file for January 1st every year is Month 1. Therefore, Month-1 makes it zero instead of making it Month 12..... of course the Year would need to be -1 as well. Any suggestions?
HPU:
LOAD [EMP FILE],
LASTNAME,
FIRSTNAME,
Company,
COMPANYCODE,
Division,
DEPT,
TITLE,
Status,
EjFTE,
[Business Unit Descrip],
TERMDATE,
STARTDATE,
SUPV,
text(Date(Date#(Month-1,'MM'),'MMM')) as MonthName,
Month,
Year,
ApplyMap('DeptGroups',[Business Unit Descrip], Null()) AS [Dept Groups],
ApplyMap('DeptGroups2',[Business Unit Descrip], Null()) AS Owner,
ApplyMap('DeptGroups3',[Business Unit Descrip], Null()) AS Area
FROM
[\\ftwqlikt001\Qlikview_Dev\External Data\Human Resources\HCUpload_*.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
What happens when you do this?
text(Date(Date#(Month-13,'MM'),'MMM')) as MonthName,
When I use
text(Date(Date#(Month-13,'MM'),'MMM')) as MonthName,
there is no change to Month but it causes MonthName not to populate with data.
Can you share a sample app and expected output as a screen shot ? Would help us to quickly figure out and work on?
You can scramble your data like here:
Preparing examples for Upload - Reduction and Data Scrambling
How do I share an app?
Click on reply and you can see Here:
Once you click on Advance editor you will have an attach icon in the bottom right.
I don't see "Use advanced editor"
Can you click on reply to your original query and still you don't see? Did you login to Qlik account?