Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey All!
I need your help about 'above' fonction,
the 'above' function does not work
thk for help
regards
Hello,
I have tried replicating your dataset on my side to test this behavior. Is this your expected outcome?
In this case you can try using the expression "=above(TOTAL sum(Charge))" as a Measure in the table. If this is not the expected output, please elaborated in detail as to what exactly you are trying to achieve.
I hope that this information was helpful.
Hello,
Thanks for the additional information. According to the official documentation for the Above() [1] function: "Above() evaluates an expression at a row above the current row within a column segment in a table". Additionally, in the Example 1 we can see that the expression is "Sum(Sales)" and for the expression of "Above(Sum(Sales))" the number of first row is "-" as there are no data above first row and then we can see the rest of the numbers appear in the table. In the example that I have shared with you the Above() function is doing exactly this.
Additionally, from the new information that you have shared, I can see that you are using the function RangeSum() as well. According to the official documentation [2], this function is suppose to sum a list of numbers. For example: RangeSum (1,2,4) = 7 and it is also stated that it sums up numeric values, otherwise it will interpret non-numeric values as 0 (e.g. RangeSum (1,2,4, Null(), 'Test') = 7). Testing both RangeSum() function and the Above() function in Qlik Sense I can see the following results:
As you can see I have the same data as yours on my table as well for the "Test" column. Analyzing further the details, for the first 5 rows, we can see that:
As you can see the results are presented as expected. Because for the first row, the expression Above(Sum(Descentes2)) will return Null as above 1st row there are no data and RowNo() will return 1. Therefore, the RangeSum() on row 1 will have the data RangeSum(Null, 0, 1) and thus the return is 1. For the second row the expression Above(Sum(Descentes2)) will return the value 1, which is the result of Sum(Descentes2) of row 1. Then the RowNo() will return the value 2 (since it is the second row), which means that RangeSum(1, 0, 2) will equal to 3 and this is the result that we see for the second row.
In your screenshot you have mentioned that expression of AB is =Sum(ndDescentes2), however I believe that there could be a difference in your dataset, because I have used the same expression on the data of the filed "Descentes2" that you have provided and I am not getting the values that you have under your AB column. However the columns "Descente2" and "Test" that you have appear exactly the same in my reproduction and the results are the expected ones.
I hope that this information was helpful.
---
Hello,
I have tried replicating your dataset on my side to test this behavior. Is this your expected outcome?
In this case you can try using the expression "=above(TOTAL sum(Charge))" as a Measure in the table. If this is not the expected output, please elaborated in detail as to what exactly you are trying to achieve.
I hope that this information was helpful.
Hello Andrei,
first, thanks for your reply and help.
the expression "=above(TOTAL sum(Charge))" dsn't work.
the "Test" column must have the same result as the "AB" column.
mesure column AB:
mesure column Test
rangesum(above(TOTAL sum(nbDescentes2)),0,rowno())
the datas :
CléComptage | Descentes2 | AB | Test |
44-2021-10-17-7485-t_allen1-101-0 | 1 | 1 | 1 |
44-2021-10-17-7485-t_batt1-101-0 | 7 | 8 | 3 |
44-2021-10-17-7485-t_brula1-101-0 | 1 | 9 | 10 |
44-2021-10-17-7485-t_brule1-101-0 | 1 | 10 | 5 |
44-2021-10-17-7485-t_cano1-101-0 | 1 | 11 | 6 |
44-2021-10-17-7485-t_cdp1-101-0 | 2 | 13 | 7 |
44-2021-10-17-7485-t_cham1-101-0 | 11 | 24 | 9 |
44-2021-10-17-7485-t_chr1-101-0 | 0 | 24 | 19 |
44-2021-10-17-7485-t_epo1-101-0 | 0 | 24 | 9 |
44-2021-10-17-7485-t_farg1-101-0 | 5 | 29 | 10 |
44-2021-10-17-7485-t_hdc1-101-0 | 0 | 29 | 16 |
44-2021-10-17-7485-t_idf1-101-0 | 0 | 29 | 12 |
44-2021-10-17-7485-t_lila1-101-0 | 6 | 35 | 13 |
44-2021-10-17-7485-t_malc1-101-0 | 1 | 36 | 20 |
44-2021-10-17-7485-t_marn1-101-0 | 3 | 39 | 16 |
44-2021-10-17-7485-t_micro1-101-0 | 4 | 43 | 19 |
44-2021-10-17-7485-t_orc1-101-0 | 2 | 45 | 21 |
44-2021-10-17-7485-t_poly1-101-0 | 0 | 45 | 20 |
44-2021-10-17-7485-t_psan1-101-0 | 0 | 45 | 19 |
44-2021-10-17-7485-t_repu1-101-0 | 1 | 46 | 20 |
44-2021-10-17-7485-t_revo1-101-0 | 7 | 53 | 22 |
44-2021-10-17-7485-t_rose1-101-0 | 2 | 55 | 29 |
44-2021-10-17-7485-t_schw1-101-0 | 0 | 55 | 25 |
44-2021-10-17-7485-t_tbern1-101-0 | 1 | 56 | 24 |
44-2021-10-17-7485-t_ufr1-101-0 | 0 | 56 | 26 |
have a good day
Hello,
Thanks for the additional information. According to the official documentation for the Above() [1] function: "Above() evaluates an expression at a row above the current row within a column segment in a table". Additionally, in the Example 1 we can see that the expression is "Sum(Sales)" and for the expression of "Above(Sum(Sales))" the number of first row is "-" as there are no data above first row and then we can see the rest of the numbers appear in the table. In the example that I have shared with you the Above() function is doing exactly this.
Additionally, from the new information that you have shared, I can see that you are using the function RangeSum() as well. According to the official documentation [2], this function is suppose to sum a list of numbers. For example: RangeSum (1,2,4) = 7 and it is also stated that it sums up numeric values, otherwise it will interpret non-numeric values as 0 (e.g. RangeSum (1,2,4, Null(), 'Test') = 7). Testing both RangeSum() function and the Above() function in Qlik Sense I can see the following results:
As you can see I have the same data as yours on my table as well for the "Test" column. Analyzing further the details, for the first 5 rows, we can see that:
As you can see the results are presented as expected. Because for the first row, the expression Above(Sum(Descentes2)) will return Null as above 1st row there are no data and RowNo() will return 1. Therefore, the RangeSum() on row 1 will have the data RangeSum(Null, 0, 1) and thus the return is 1. For the second row the expression Above(Sum(Descentes2)) will return the value 1, which is the result of Sum(Descentes2) of row 1. Then the RowNo() will return the value 2 (since it is the second row), which means that RangeSum(1, 0, 2) will equal to 3 and this is the result that we see for the second row.
In your screenshot you have mentioned that expression of AB is =Sum(ndDescentes2), however I believe that there could be a difference in your dataset, because I have used the same expression on the data of the filed "Descentes2" that you have provided and I am not getting the values that you have under your AB column. However the columns "Descente2" and "Test" that you have appear exactly the same in my reproduction and the results are the expected ones.
I hope that this information was helpful.
---
hello Andrei_Cusnir
First, thank you very much for very detailed reply,
I took your advice into account
had a good day
Aubry