Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, I have a table in which the data can be aggregated by the fields A and B, as in the following image:
You can see in this pivot table how the data is aggregated.
my request is calculate the date diff of the field date2 with the previous row (es: i m in the row 3, i should calculate the date diff of field date2 of row 3 and row2), and for the first item of each aggregated data the date diff between date2 and date1.
I'd accept both the resolution in script and in frontend.
Sorry for my English and thank you very much if you can help me!!
Hi!
This can be done either in the script or in the layout.
In the script, you would need to load your data sorted by all the key fields (A, B, C) and then chronologically by Date, and in the load, you'd use functions Previous() and Peek() to fetch the date from the last record and to verify that the last record belongs to the same set of keys (A, B, C). You can read about this technique in my blog.
In the layout, you'd need to use the function Above() to fetch the value from the row above.
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!
Hi!
This can be done either in the script or in the layout.
In the script, you would need to load your data sorted by all the key fields (A, B, C) and then chronologically by Date, and in the load, you'd use functions Previous() and Peek() to fetch the date from the last record and to verify that the last record belongs to the same set of keys (A, B, C). You can read about this technique in my blog.
In the layout, you'd need to use the function Above() to fetch the value from the row above.
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!
Thank you, your suggestion works well!!!