Dashboards & Visualizations

How to achieve correct chart visualization & overlay?

Manasa_401
Communicator

Hello Splunkers

Need your help to get the desired result.
Below is the sample query for reference.

| makeresults
| eval week_year="2022-48",group="ABC",old=64,new=78
| append
[| makeresults
| eval week_year="2022-48",group="XYZ",old=35,new=15]
| append
[| makeresults
| eval week_year="2022-49",group="XYZ",old=33,new=17]
| append
[| makeresults
| eval week_year="2022-49",group="ABC",old=215,new=158]
| fields - _time
| eval target1=round((old/new)*0.17,3)*100,target2=round((old/new)*0.26,3)*100,final=round(old/new,3)*100
| table week_year group final target1 target2
|chart last(final) as final values(target1) as target1 values(target2) as target2 over group by week_year


But since values() is used we are getting target fields for each week. But expected outcome is to get one each line for target1 & target2.

 

Manasa_401_3-1671198928650.png

 

Please help me to get the visualization in correct format.

Thanks in advance!!

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is not clear what you expect the chart to look like

Having said that, does this help:

|chart last(final) as final values(target1) as target1 values(target2) as target2 over week_year by group
0 Karma

Manasa_401
Communicator

Hello @ITWhisperer 

If you run till the table command you will get the results as shown below.

Manasa_401_0-1671202109451.png

my required visualization is to show data in below similar format, but instead of 4 lines i just need one each line for both targets.
I need help on the query to get desired format.

Manasa_401_1-1671202191442.png

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Given your sample data, what points do you want shown on the two lines?

0 Karma

Manasa_401
Communicator

I need target1 and target2 values to be shown as line

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Which value do you want for target1 for ABC and which value do you want for target1 for XYZ? You have two possible values given the data you presented - that's why you have more lines than you were expecting; the lines are doubled up because you have two year-weeks

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...