How to transform row to field and keep first column?

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    transform data from row to filed, first column userName do not transform

  • How are you trying to achieve it?
    raw data before transform

  • What happened?
    Not 100% meet my request

  • What did you expect to happen?
    This is my expected result:

This is what I can have now:

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

What other ‘Transforms’ are you using?
I noticed you used 7 in total.

Thanks for your attention to the issue. I extracted data from a {} to get the info I want and do some basic filter to keep useful data.

Any idea to get it done? Thanks for your help

My hunch is that it has something to do with the ‘Group by’ you are using.
Everything is collapsed in your screenshot but it looking at the result it looks like you are grouping by ‘username’

(and double check what is under ‘Organize field’ you can hide columns there too :wink: )

Try to see what happens if you ‘hide’ (the icon on the right of the transform) the ‘Group by’ transform. Leave the rest visible

And what happens if you change/switch the order (this can effect the end result) of transform are using Drag ‘Group by’ under ‘Rows to fields’

You can do so by clicking and dragging the 6 dots on the end like example below.

Thanks for the reply, I think the problem is I used 2 groupby(userName and previous state), which I have to…

My purpose is to present the data by individual and by how many time they stay on each state. If I only use groupby userName, I will only get sum of total duration of all state. However, I want to break it down.

Now I disable unnecessary step, keep 3 alive. See below picture

before enable rows to filed

after enable rows to filed

transform move userName column into filed, which I wanna keep and drop_duplicate.

I tried to reproduce but I now have a better understanding of your challenge.
To be honest I don’t know if this can be achieved with the ‘Transform’ function(s)

What is your datasource?