I tried to copy someones formula for making a top 5 list and I did my best to switch out values with the ones that correspond with my list. Why is it repeating values?
QUERY is possible way to find top N rows:
=QUERY({A:B},"select Col1, sum(Col2) group by Col1 order by sum(Col2) desc limit 5")`
Related
I'm obtaining a list of unique values with this formula:
=ArrayFormula(VLOOKUP(UNIQUE(REGEXEXTRACT(FILTER(A2:A1000,A2:A1000<>""),"\d+"))&"*",REGEXEXTRACT(A2:A1000,"\d+.+$"),1,FALSE))
I did this for 3 different sheets, in each sheet has different values but in some cases these are repeated across the sheets like this:
These are the final list after the formula:
After this I used this formula
=COUNTIF(Sheet3!$A$2:$A$500,A2)+COUNTIF(Sheet4!$A$2:$A$500,A2)+COUNTIF(Sheet5!$A$2:$A$500,A2)
I get this:
Actually it works as I want but is not a dynamic function I would like to have the list of the unique values and the times appearing across the sheets if is possible
Here is the problem with some text in the row that I have with []
Use below QUERY() formula-
=QUERY({Sheet3!A:A;Sheet4!A:A;Sheet5!A:A},"select Col1, Count(Col1)
where Col1 is not null
group by Col1
label Col1 'List of Values', Count(Col1) 'Count'")
In this scenario, I am looking to total Columns G through M by 'user' in Column E. Column N does have the correct data, but it is using the formula =sum(f4:m5). I am looking for a way to add an array formula because the heights of the merged cells in column N varies often. A formula would be preferred to a script in this case.
try:
=INDEX(IFNA(VLOOKUP(F2:F,
QUERY(SPLIT(FLATTEN(IF(G2:M="",,F2:F&"♀"&G2:M)), "♀"),
"select Col1,sum(Col2) group by Col1"), 2, 0)))
Given this type of data:
Suppose I want to make two different graphs, one for the individual count of the items in the Order column and one for the Pets column. What would be the simplest way to do this?
Note that I want to graph the count of each item, and not group of items. This way I'd obtain a count of 4 - Burger, 2 - Pizza, and not 1- Burger, 1 - Pizza, Coke and so on.
First count the number of burgers or pizzas etc. using custom column 'Pizza' using formula
if (Text.Contains([Order],"Pizza")) then 1 else 0.
Then write measures to sum the count.
Measure_Pizza = SUM([Pizza])
Then use measures in charts.
Alternate solution:
Write measures to directly calculate the count
Pizza_count = CALCULATE (COUNT( Snacks_and_Pets[Order] ), FILTER(Snacks_and_Pets, FIND("Pizza", Snacks_and_Pets[Order], , 0 ) <> 0 )
i want to create a calculated column, which will show two values: Y or N
2 columns are here important, "VAT-ID" and "CUSTOMER-ID". the calculated column will check if a customer-ID has multiple VAT-IDs. If yes the value "Y" should be displayed, else "N".
for example, the first 5 rows of the customer-id column are:
123456
654321
666666
123456
654321
the first 5 rows of the VAT-id column are:
EE999999999
AA999999999
GG999999999
KK999999999
AA999999999
the first 5 rows of the calculated column should be then:
Y
N
N
Y
N
any Help would be appreciated
Calculated columns don’t allow for aggregations across groups or other than the current row.
What you can do to achieve your goal is to create a separate aggregation node and count distinct VAT-IDs grouped by CUSTOMER-ID.
With this, you can now have a calculated column that checks for VAT-ID-COUNT > 1 and map it to your Y/N values.
As Lars mentioned it is not possible to use a window function within a calculated field on HANA table
But you can use following query to check if VAT number is multiple for a customer or not
select
CustomerId, VATID,
case
when (count(*) over (partition by CustomerId, VATID)) > 1
then 'Y'
else 'N'
end
from CustomerVAT;
I have a problem to solve similar to the example in the image below. I have the values of Column 1, 2 and 3, and want to get the calculated values exampled in Column 4. These are the number of times that the same number of Column 3 appears for different combinations of values from Column 1 and 2.
Thanks in advance for any help!
If your table has as name 'table1',
then the following dax statement will calculate column4.
Column4 = CALCULATE(countrows(Table1);filter(Table1;Table1[Column3]= EARLIER(Table1[Column3])))
Keep in mind that based on regional settings, you have to replace the ; with , in the example provided.