How to get the price change % from the two records of the same item?


We have two records of the item 1 inserted at time 25 aug 12:23:00
The second record inserted at 25 aug 12:25:46

I have shared a screenshot reference.

I really appreciate a quick response

The event types are not really tables. With think of them like that, but they aren’t. Not sure what you mean by inserting json data. Do you mean one attribute on the Maturity event has json data?

Do this:

Select Keyset() from Maturity since 7 days ago

Can you rephrase this? Maybe use some pseudo code to represent what you are saying?

1 Like

@6MM I have updated it.

It’s confusing to edit previous posts in a forum. It makes it hard for future reads to follow threads.

If you can change how you are forming your data before sending to new relic it would help.

You can try earliest() and latest() and do the math.

@siddiqui.208 Can you clarify if your update resolved your issue or are you still needing further support?

SELECT latest(timestamp) As Q1, earliest(timestamp) As Q2 FROM SKUM FACET Base WHERE event=‘SDS’ SINCE 1 day ago LIMIT 2

I have created this Query but not able to get percentage

Doesn’t look like you are trying to get percentage.

Are you not trying to use the BASE value?

HI @6MM @JoiConverse ,

Thank, for the quick response
Let me explain what I want to achieve, find the below step scenario.

  • List item
  1. Insert data using the insight insert key using this command.

gzip -c sku-maturity.json | curl --data-binary @- -X POST -H “Content-Type: application/json” -H “X-Insert-Key: ------------------” -H “Content-Encoding: gzip”

  1. Run this query “SELECT * FROM SKUM” in Query Builder to validate data.

  2. It’s display look like attach screenshot.

  3. we want to get the percentage between two values of the product, Item, Base. of respective store banner SDS, FLE, FLAP, FLNZ

  4. Above step we have done successfully.

  5. What we want here is just to write a query to get the latest value of the Base fields column.

SELECT latest(timestamp) As Q1, earliest(timestamp) As Q2 FROM SKUM FACET Base WHERE event=‘SDS’ SINCE 1 day ago LIMIT 2

  1. So we got the Base latest and earliest value when running the above query.

  2. We want percentage value
    August 30, 2021 05:47:06: 605
    August 30, 2021 04:38:25: 606

We want a query to get the Percentage. I am not able to write the query. So please help me or suggest write the query to get our result. I have shared a screenshot of the manual process to get the percentage.
Please let me know if you need more information. I will explain.

You can do latest(base) and earliest(base). Maybe that gives you a hint.


This topic was automatically closed after 365 days. New replies are no longer allowed.