Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to make an expression based on previous rows??? help needed

Hello all,

I have a scenario, which i am unable to solve in QV. The scenario is given below

on Date D1, we have No of extracted rows 1000, on D2 900, on D3, 950, On D4 100. Now let suppose on D5 the extracted rows is 100, which is much less than the standard deviation or you can say the average of previous days, then i want to mark this cell as red. How can I calculate the avarege based on previous days and then compare D5 value with previous days.

To clerify it, I am making the following sample date

D1 D2 D3 D4 D5

Job1 1000 900 950 100 100

Job2

Job3

Now in the abve table, the I want to compare every date with previous dates average and if the difference is greater than 20%, then i want to mark it red.

Average = (date-4+date-3+date-2+date-1)/4 which in this case is ------> (D1+D2+D3+D4)/4

percentage difference= (todays extracted rows/average)*100

If (percentage difference >20) mark the cell red

Please read this scenario and help me. Let me know if anything is unclear

Arif

21 Replies
Not applicable
Author

Hello,

I have another issue popping up in my reports which i have simulated in the same report that we worked on earlier. I am attaching the application file as well, but am explaining the issue from the image below

The rangesum formula is using the before function and rangesum function to sumup the data in the before columns.

as you can see, on 24, we have some 692223 rows. on 25, the rangesum should calculate the number of rows in the before columns and hence it should be giving the same number 692223, but here, it is giving 0. the rangecount is calculating the number of earlier no of rows where data is not zero so it is working fine but rangesum is not working correctly.

Can you please have a look at the qvw file and let me know what mistake am i making here.

I hope that some of you, who helped me earlier can quickly get what is wrong in my expression. Please ask if unclear

Arif

nathanfurby
Specialist
Specialist

Try changing the RangeSum calc to this:

RangeSum(Before(Sum(no_of_rows),1,NoOfColumns()))