Hi,
So I only need to drag the text of the store that was selected the most in the previous set of questions.
Yes, only.
But first you have to calculate the maximum, see which store(s) are affected, deal with ties, ...
I'd do it like that (only using some equations)
1. What is the maximum of mentions?
Here you may use the functions "max" and "countif", like
equation called "eqMax":
{max(countif("1",P8da01.NAOK,P8da02.NAOK,P8da03.NAOK,P8da04.NAOK,P8da05.NAOK,...),countif("2",P8da01.NAOK,P8da02.NAOK,P8da03.NAOK,P8da04.NAOK,P8da05.NAOK,...),countif("3",...))}
2. Which stores were mentioned with this frequency?
Here I build a string with symbols ("A", "B", "C",...) that represent the stores.
Use the function "join"
equation called "eqStores"
{join(if(countif("1",P8da01.NAOK,P8da02.NAOK,P8da03.NAOK,P8da04.NAOK,P8da05.NAOK,...)==eqMax,"A",""),if(countif("2",P8da01.NAOK,P8da02.NAOK,P8da03.NAOK,P8da04.NAOK,P8da05.NAOK,...)==eqMax,"B",""),if(countif("3",...))}
You may get something like "CKO"
To avoid the double calculation of "countif" you could use an array(text) or a "multiple numerical input" to store the results of each "countif" in first equation "eqCount" and use this in the next two equations.
3. We may get more than one store with the same frequency (as shown above). So we select one at random.
First create a random number from 1 - the length of "eqStores" (the number of stores with the same maximum frequency)
Using functions "rand" and "strlen".
equation called "eqRand"
{if(is_empty(eqRand),rand(1,strlen(eqStores)),eqRand)}
4. Now we grab the character from "eqStores" that is in this position "eqRand".
Using function "substr".
equation called "eqStore"
{substr(eqStores,eqRand-1,1)}
5. Either in your question or - as I show - in a last equation before the select the storename in a simple nested IF.statement.
equation called "eqStoreName"
{if(eqStore=="A","Walmart",if(eqStore=="B","Walmart Express (Superama)",if(eqStore=="C","Bodega Aurrera",if(eqStore=="D","Mi Bodega Aurrera",if(eqStore=="E","Bodega Aurrera Express",if(eqStore=="F",...."")))...))))}
Of course: All these equations are hidden after testing.
6. The your question looks like
Why do you mostly buy your products in {eqStoreName}?
Joffm
By the way:
How do you imagine to deal with your "Other"?
1. You have to include the Code "-oth-" into the calculation.
2. You do not know which store it is.
Let's explain:
You get a frequency of 13 "Others", which is the maximum.
This might be one single "other" store.
But also there might be 13 different stores inserted, so that each of these "other" stores only was mentioned once.
Please, consider this.