Good afternoon. I am trying to use the Rank functi...
# gooddata-platform
a
Good afternoon. I am trying to use the Rank function at MAQL to order by Checkl Id Preench or Date, within the same Carro Placa. The expected results would be the values from Image 01, 1 for the most recent Date, or highest Checkl Id Preench, 2 for the second, and so on. But when I put Checkl Id Preench in the MAQL (image 02), the values from the column Rank Within don't have a defined order (image 03), and then I Rank by the Date (image 04), all the values are 1 in the Rank Within column (image 05). I believe this has to do with the columns format, because they are in Attribute or Date format. And the Checkl Id Preench is the primary key of Sadacarr Fchecklists, so I can't put as Measure. Can somebody help me to get this Rank working, please?
j
Hi Augusto, Rank metric will not work like this on the date dimension. You will want to first build a metric to Count Checkl Id Preench (Metric 1). Then, you can build a Rank metric as follows: select rank (metric 1) DESC WITHIN (Carro Placa).
a
Hi Joseph, thanks for the help so far. The Metric 1 should be how, exaclty? Because just putting SELECT COUNT (Checkl ID Preench), and Using this Metric 1 on the Metric, the result on the column Metric 2 is just many 1's in the column
I used Max (Date) function to turn the date to Attribute (Number Format), and after this, tried to Rank Data em Numero (since it's an attribute) WITHIN Carro Placa and apply Row Number, but all the Results are 1. If you can help me more direct to the point, I would like to have just the most recent Checklist por each Carro Placa, so I just need one register (the most recent) for each Carro Placa
j
You will need to create a Rank over Time Report. The pics and steps are related to the old UI in the old reporting tool, but the logic is the same. This will give you the top ten within each date dimension.
a
Hi Joseph, sorry for bothering you again, but no one of these metrics are working for me 🥲. I got Data em numero, what would be the Date in a Measure format, Now I just want the most recent record, what would be the highest number in Data em numero for each Carro Placa. So for FQS8000, I just want the line of Checkl Id Preench 9608153, for FQV0870 the line of 9910533, and so on. I tried to rank using Rank Within, tried to pick the Greatest value, but I believe it picked the Greatest Data em numero for each line, not for the same Carro Placa. How can I pick the greatest value for each Carro Placa, please? One possiblity, if one of the Rank functions worked for me, was to get 1 in the desired lines, ans then, filter on MAQL (Nameofthecolumn = 1), but I believe I am doing something wrong. Thanks in advance
a
@Joseph Heun?
j
Hi guys, I have access to the workspace and I am looking over the LDM and report.
🙌 1
🙏 1