Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have an a table like:
Months | Jan | ||
Business Group | FTE | Headcount | Current Month vs Previous Months |
A | 107.3 | 117 | 0 |
B | 5.35 | 6 | 0 |
c | 57.82 | 74 | 0 |
d | 49.99 | 55 | 0 |
My expression is: Count(Employee)
Does anybody know how to write an expression for calculation of difference Month vs Previous month. For example February vs January?
I used an expression like: Count(Employee)- before(Count(Employee) but it shows me null when a selection of month is made.
Unfortunately this doesnt work either Nobody knows how to calculate this difference?
My first dimension is Business group, and the second one is 'Months'. I dont have MonthYear or Year or anything else
Diana we all are providing you the solution based on what we think your fields, formats etc may look like. This is the best we probably can do without looking at your application.
Best,
Sunny
try some thing like below
count(${<Month={$(=max(Month))}>}employee)-count({<Month={$(=Max(Month)-1)}>}employee)
If Month is one of your dimensions then I wouldn't probably use set analysis. Above/Below function if a straight table or After/Before function if pivot table (and months are laid out horizontally) will be required. But again the ideal solution can only be provided if and when you can provide some data.
HTH
Best,
Sunny
Create a monthend dateID use it in the set analysis expression
count({<DateID={$(=max(DateID))},Month=>}employee) - count({<DateID={$(=max(DateID)-1)},Month=>}employee)
hope this helps.
Hi Diana,
Create 2 variables. (Ctrl + Alt + V --> Add)
vMaxMonth = Month(Max(YourDateField))
vMaxMonthPrior = Month(addmonths(Max(YourDateField),-1))
In your graph, create these expressions:
1st Exp for Selected Month =Count({<Month ={'$(vMaxMonth)'}>} Employee)
2nd Exp for Prior Month of selected = =Count({<Month ={'$(vMaxMonthPrior)'}>} Employee)
Hope this helps.
PS: Name the expressions
1 = Headcount $(vMaxMonth)
2 = Headcount $(vMaxMonthPrior)
Regards,
N
Hi Diana,
You will need to tweak things to match the fields you have in your model, but the app I uploaded to Qlik Community should give you a good head start on this:
QlikView App: Set Analysis - Prior Period Comparison
There are also some notes on how the app works which may be useful.
Steve
Is your Month column just a text column with names of months or is it a Month converted Date column (like =month(Date))?
These formulas arent working, here is my sample data attached.
Please help!