Discussion board where members can learn more about Qlik Sense App Development and Usage.
I am struggling with a small requirement, attached a small piece of data, in that there are two yellow back grounded columns which need to be calculated.
every project has a start month and end month, I want two new columns like number of months, avg Savings
Project ID, StartMonth, EndMonth,Savings, countofmonths,Avgsavings
101, Jan 17 , Apr 17 , 4000 , 4 , 1000
count of months is derived as Jan, Feb ,Mar, Apr(count) and AvgSavings as Savings/Countofmonths ie 4000/4 = 1000
Hope I am clear
Have you seen this to calculate month difference?
How Do I Get the Number of Months Between Two Dates?
So to use this should I convert my start months to first date of that month and End month to last date of that month?
You don't have to... as long as you don't want dates to have any impact on the count of month... the expression should handle everything for you
Just checked the post you gave I think it doesn't take into account the dates , I think I can use it
thanks for the stress on that post
Sunny can we bring in the number of rows equivalent to the count of Months
Project ID, StartMonth, EndMonth,Savings, countofmonths,Avgsavings, Month
101, Jan 17 , Apr 17 , 4000 , 4 , 1000 , Jan17
101, Jan 17 , Apr 17 , 4000 , 4 , 1000 , Feb17
101, Jan 17 , Apr 17 , 4000 , 4 , 1000 , Mar17
101, Jan 17 , Apr 17 , 4000 , 4 , 1000 , Apr17
Sure, you can use a while loop to do this...
Loops in the Script
Thanks sunny for the post, I will take from here ..