Which of the following searches would return a report of sales by product_name?
Which of the following searches would return a report of sales by product_name?
To generate a report of sales by product name, the correct search would need to aggregate the sales data and group it by the product_name. The option 'chart sum(price) as sales by product_name' achieves this by using the 'chart' command to sum the price and alias this sum as 'sales', then group the results by 'product_name'. This produces a chart or report that displays the total sales amount for each product name.
C is not possible B its correcte
Correct, B is the answer. "over" and "by" can be used with chart, only "by" can be used with stats, so C doesn't work. https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Chart https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/Stats
B is correct
B - P50 Also, as stated before "by" or no clause can be used with stats so C is out.
C would result in an error
only B is correct
Correct Answer is A. The option B , treats sum(price) as number of sales .... BUT sum(price) of a product is NEVER the amount of sales ? sales means the number of products sold and it'll be a different field altogether.
Though the above interpretation holds true , I realized that the answer will be B , only , as a chart command must make use of a function , and that happens only in the option B. Please correct me If i'm wrong Thanks