I am looking for some advice on how to create a quarters field.
To give you some background, I have a script that looks like this, it's pretty simple:
So, I had a number of tables which each have tables for Employee ID, Gender and Current Job Title. Each table pertain to a different month so I used the FileBaseName function to generate a field based on the name of the excel document.
Now, would it be possible to generate a field called quarters?
If you could, please provide an explanation of how your expression works, as this is just a test and I'd like to be able to apply the solution myself to other data sets.
Thank you in advance,
Solved! Go to Solution.
Hello Again Marcus,
I am sorry but I don't understand.
Why do you want to divide the month-value by three? What is the ceil function? I have looked it up on the QlikSense website but I don't understand, it's a little advanced for me.
Ceil is a rounding-function like round() or floor() - more could you find here: Ceil - script and chart function ‒ Qlik Sense. To divide the month-value with 3 and rounding the result is just a mathematically shortcut to avoid to query each value and assigning an equivalent value for it within a conditional function like this one:
if(Month = 1, 1, if(Month = 2, 1, if(Month = 3, 1, if(Month = 4, 2, ...) as Quarter
1, 2) are the second/third parameter of the mid-function and mean that the function returned 2 chars beginning from the 1 sign of the string - which is the filebasename() in your case. 3 is just the fix divisor -like above described.
Thank you, I understand it a lot more now!
Please can I ask one more question of you. I am a little bit unclear about the 1,2.
Am I right to assume that they designate the months?