Hi
this calculated field does not show an error message, but it does not work:
ifelse((codsku=‘501’ AND codsku=‘570’), cajasfact, 0)
I am looking for the sales of 2 items grouped.
Does anyone know how to obtain this in another way? or why this does not work?
I would appreciate it if someone could explain it to me at the kindergarten level
Thanks in advance
Ifelse does not work correctly if you use the calculated value in an aggregated table afterwards.
You should use the following function. sumIf - Amazon QuickSight
@tb102122
Yes it works like this
This function has the total sales of both codes But I would need to Count the number of customers, who bought -both codes- together. How do I get that?
Do you need the total number of customers or the total sales?
That will depend on your data model but I would assume you can use this for the total customers.
distinct_countIf(<<CUSTOMERID>>, codsku=‘501’ OR codsku=‘570’)
Sorry I think you misunderstood. I would need to know the data structure from your in your analysis. There is no issue in the functionality provided by the Quicksight team.
@tb102122 OK How do I inform you my data structure? What would you need to know about my data structure to understand what I need to solve? Thanks in advance
If you only need it with based on similar table like you shared I would use filters. If you have more of these combination you like to visualize I would suggest building up another dimension Customer_segements with PK as customer_id and columns for each criteria. These columns you prepare either with a customer SQL in Athena or during your ETL process.
@tb102122 Yes I need the number of clients in a table , but as I told you at the beginning of my post, the data cannot be obtained through filters . The filters calculate with the OR criterion and I need to obtain the customers who buy from both codes This would be possible using the AND criterion. For everything else you tell me, I wouldn’t know how to do it.
AND will not work either based on my understanding of your data structure, since you have basically multiple lines per transaction in your fact table.
So you basically need to get all rows with yout items ideas and than you need to get the customerids with both transactions.
Are you loading your fact table from Athena?
is cajasfact a numeric value? is “codsku” a string? Could you please share the dataset? For ifelse, the if branch and else branch should have the same data type.
Hi @sanmar. Has this been resolved? If so, please help the community by marking the appropriate post as “Solution”. If you still need assistance, please provide additional detail. Thanks!