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.
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:
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.