Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I'm hoping that you can help me, I need to reference data from a previous record. What I have is a data source set up as:
Product Date Amount
And what I want to do, is show a data range (From and To), show for each record, the date to is the date in the row and the date from is the previous date for the same product/site/domain.
I've created a basic test app to show you what I mean. I hope you can help me!
Kind Regards,
Dayna
Hello Dayna,
If possible I'd create taht in the script, something like
Data:LOAD Product, Date(Date) AS DateTo, If(Product = Previous(Product), Previous(Date), 'n/a') AS DateFrom, AmountFROM FileORDER BY Product, Date; // Data source
Hope that helps.
EDIT: Checked "Previous(Date) as DateFrom", my fault.
Hello Dayna,
If possible I'd create taht in the script, something like
Data:LOAD Product, Date(Date) AS DateTo, If(Product = Previous(Product), Previous(Date), 'n/a') AS DateFrom, AmountFROM FileORDER BY Product, Date; // Data source
Hope that helps.
EDIT: Checked "Previous(Date) as DateFrom", my fault.
Hello Miguel,
Many thanks for your response, I tried it on my script and I get the below which puts the same date in both fields rather than the previous date.
Kind Regards,
Dayna
Yep, I noted after posted I missed a Previous(Date) (obviously) in the script. I corrected it above.
Thought that was the case! Looks good! Hope it can work when my app gets more complex!
Many thanks Miguel!