Discussion board where members can get started with Qlik Sense.
Please help me with the following. In the table below, I have columns "Index", which is the function RowNo(total), and "Hours". I am interested in getting the column "Result". Essentially, "Result" is "Index", but the difference is where the observations "Hours" have the same value, I sum their corresponding "Index" and then divide by the number of "Index".
For instance, for "Hours" 2, the frequency is 3. We do: (2+3+4)/3 = 3. For "Hours" 4: (5+6)/2=5.5. For "Hours" 6: (8+9)/2=8.5. All in all, I want to come up with an expression(charts only, no script) where I use the first two columns to get the third column.
Here is what I have done so far, but has not been working as desired:
if (pick(count(total [Hours]) - rowno(total) + 1, $(=concat([Hours], chr(44), -[Hours]))) =
pick(count(total [Hours]) - rowno(total) + 2, $(=concat([Hours], chr(44), -[Hours]))), rowno(total)+rowno(total)-1,
Thank you for your time and help.
That line of code does not get me the "Result" column.
FYI I am using rowno(total) as the "Index" column. And please note, for the "Hours" values that do not have duplicates, their indices remain untouched.
In your initial post you said "In the table below, I have columns "Index" and "Hours"". Then you said you are using RowNo(TOTAL) as Index. Is that just for example or do you want your solution to use RowNo(TOTAL)?