Issue With URL Action

Hello Team -

Part A ]

I am trying to Use URL action in the visual below :

This is how my ideal setup look like before implementing URL action -

Dynamic View is :

ifelse(

    ${DynamicView} = "SKU", {Brand SKU},

    ${DynamicView} = "Brand", Brand,

    Retailer

)

Here, when I select Retailer under Dynamic View, even though two product types (Blenders and Monitors) are selected in the top Product Type filter, the visual displays three entries based on the unique retailer, brand etc.

Part B ]

I am now trying to embed a URL action in this visual so that when a user selects SKU under Dynamic View, clicking on a SKU takes the user to that SKU’s product page in our app.

URL setup is - https://app.ABC.com/products/discovery?categories=<<Category_ID>>&brands= << Brandname>> &part_numbers= <<SKU>> &firstSeenFrom=2022-01-01&firstSeenTo=2030-01-05

In this case, three fields need to be dynamic and included in the visual: category_id, brand_name, and SKU.

I have tried two different setups. In both cases, the URL action works correctly, but the granularity of the visual changes.

  1. In this setup, I used dataset-level fields (category, brand, and SKU) and kept them hidden in the visual. While the URL action functions as expected, it impacts granularity.

    For example, when I select Retailer under Dynamic View, and two product types (Blenders and Monitors) are selected in the top Product Type filter, the visual shows multiple entries per retailer. A similar issue occurs when selecting Brand.

However, I Need only three entries, as shown in Part A.

  1. I have tried one more approach here again by creating fields for brand and SKU like below:

Brand for URL

ifelse(
${DynamicView} = ‘SKU’,
{Brand},
null
)

SKU for URL

ifelse(
${DynamicView} = ‘SKU’,
{SKU},
null
)

Since I want the URL action to work only at the SKU level (and not for Brand or Retailer), I have configured it accordingly. The action itself works as expected.

However, the granularity issue still persists. For example, when I select Retailer under Dynamic View, and two product types (Blenders and Monitors) are selected in the top Product Type filter, the visual shows six entries three per retailer. A similar behavior is observed when Brand is selected. (for single product being selected lets say only monitor then this approach does work well)

What I am trying to achieve is to enable the URL action in this visual without introducing multiple grain issues. The visual should behave exactly as shown in Part A, while still having the URL action enabled with the required fields.

In other words, the URL action should work only at the SKU level, but the visual grain should remain consistent when Retailer or Brand is selected under Dynamic View, without creating duplicate entries.

I understand that having unique multiple retailers will create multiple entries, but the visual should not duplicate beyond the selected level. The granularity should stay consistent with the chosen Dynamic View.

As shown below, selecting all product types returns unique retailers, without repeating retailers for each product type (and the same applies to Brand).

Note -

  1. https://app.ABC.com/products/discovery?categories=<<Category_ID>>&brands= << Brandname>> &part_numbers= <<SKU>> &firstSeenFrom=2022-01-01&firstSeenTo=2030-01-05 - This URL is Fixed and cannot be changed.
  2. I can’t use the Dynamic View parameter directly in the URL action.

If i use dynamic view parameter in the action then : If SKU is selected in the parameter, Brand also resolves to SKU in the action. This causes incorrect URL values.

Expected:

<<Category =12>>
<<BrandName>> = ABC
<<SKU>> = 123

Actual when SKU is selected in Dynamic View:

<<Category>> =12
<<BrandName>> = 123
<<SKU>> = 123

Because of this, we need separate fields for Brand ,SKU and category in the action setup which is what introduces the granularity issue in the visual.

So - i) Do we need to change the URL action setup, or is there any visual-level workaround to make the URL action work only for SKU, while keeping the visual behavior the same as shown in Part A? Also, how should this be configured if the visual is a pivot table?

ii) Is there a way to configure the URL action so that users can click only on SKUs, and not on Brand or Retailer?Ideally, the “View product on app” action should be available only when SKU is selected, and be disabled for Brand or Retailer views.

Please help here

Thanks.

Hi @soham,
There is quite a lot to digest with this scenario and is a bit hard to tell all of the functionality and the setup of the data through screenshots. This scenario may be easier to assist with if you were able to upload an anonymized copy of your analysis to the Arena View.

In terms of the multiple rows being created where you only want one, what is the metric that is different (so the one causing the multiple lines), are the SKU’s different? What are the 6 entries (3 per retailer) that are showing?
If you said it’s working properly when only one product type is selected, that leads me to believe that the separate rows are accounting for the various product types selected?
If that’s the case, have you tried building a calculated field that sums the product types instead of leaving as separate rows?

Hello @Brett

Thank you for your response i have added mock setup and some notes in the arena analysis below :

URL Action Issue

Thank you!

Hi @soham,
Apologies for the delayed response/missing this! Have you tried using either a minOver or maxOver function for your category_id; that way it would avoid the duplicated rows?

Hello @Brett

Thank you for your response.

I will try that out and get back.

Thank.

Hello @Brett

I had tried using Minover, Maxover but it is giving me the same issue (row repetition for retailer) , I might not be understanding the granularity in a correct way , can you please hover around in the arena analysis and guide ?

This is what I has tried

Category new:

minOver(

Category,

\[Retailer, {Market Share Product}\],

PRE_AGG

)

Thanks.

Hello,

Any Update on this?

Thanks.

Hi @soham,
Apologies on the delay;
Looking at your questions listed in the arena view:

  • It’s reacting that way because you have multiple category id’s for options. Each time you add a field to your ‘group by’ section, it’s going to add another level of granularity. So now that each parent product has a different category id, it’s going to create split rows:

Since you’re using a dynamic view, that may make this a bit trickier as you’ll have to build a calculated field that equates for each dynamic view option as well (since each one uses different fields as it’s variables). So for each dynamic view option, you’ll need a max calculation built in.

However you’re also going to run into issues with the category id mapping field that you’ve created; trying to run aggregations and non-aggregations at the same time normally gets a bit messy in QS.

What is the logic you’re using for the ‘category id mapping?
Creating at the analysis layer is going to continue to keep giving calc. and visual errors so you may need to move that to the dataset layer to use it as a value field.

Hello @Brett

Thank you for the response.

Below is the logic I am using for parent product to its category ID mapping. This list will be long and we will add more products and category IDs to it.

ifelse(

  {Parent Product} = 'Notebooks', 6,

 {Parent Product} = 'Blenders', 26,

  {Parent Product} = 'Monitors', 11,

 {Parent Product} ='Cooktops & Wall Ovens',12,

  null

)


Now - What Could be the best possible way to overcome this issue? and achieve the expected behavior?

I have already added exact sample data into arena analysis for reference.

Thank You.

Hi @soham,
So if you mean to have a number of different category id’s, how do you expect to show in a visual with only one row; one category id value do you want captured for that individual row?

If you need it as part of your URL, will it make sense if it’s the same even though you have separate value options?
I’m not completely aware of how your aggregations will make sense to work along with your URL’s and how you want to group them so you may have to test out some various options but the reason for your separate/duplicated rows is due to aggregation happening in one field or another. I would suggest reviewing the attached documentation that helps understand aggregation functions and calculations a bit further that I think is very helpful.

Hello @Brett Thanks for the response and suggestion -

I am trying out few combinations and get back.

Thank you for understanding.

Hello @Brett

What solution I have Figured out is -

1) Brand_for_URL

Brand_for_URL =
ifelse(${DynamicView}='SKU', {Brand}, null)

2) SKU_for_URL

SKU_for_URL =
ifelse(${DynamicView}='SKU', {SKU}, null)

3) Category_ID_for_URL

Category_ID_for_URL =
ifelse(
  ${DynamicView}='SKU',
  maxOver({category_id}, [{Brand SKU}], PRE_AGG),
  null
)

In SKU view

  • Brand_for_URL → populated

  • SKU_for_URL → populated

  • Category_ID_for_URL → populated (one value per Brand SKU via maxOver)

  • Grain = SKU → 1 row per SKU → URL works

In Brand view

  • All URL fields → null

  • Grain = Brand

  • 1 row per Brand (no duplication)

In Retailer view

  • All URL fields → null

  • Grain = Retailer

  • 1 row per Retailer

  • No split into category 6 / 26, even with multi-category selection


Key point:
Multi-category filters do not affect grain because category_id only exists at SKU level.

This is how visual will look like -

For retailer -

For Brand -

For SKU -

URL will be -

https://app.ABC.com/products/discovery?categories=``<<Category_ID_for_URL>>&brands=<<{Brand for URL}>>&part_numbers=<<{SKU For URL}>>&firstSeenFrom=2022-01-01&firstSeenTo=2030-01-05

Let me know your thoughts on this workaround.

Hi @soham,
Apologies for missing your last response, this looks like a good plan of action that you’ve outlined; let us know if it worked for your case or if you encountered any issues and need additional assistance.

Thank you

Hello @Brett

This works for me.

Thanks for the response.