Ifelse with multiple conditions and included function

Hi team, I am new to quicksight and the requirement is…
datatype= actuals, opportunity =won , month= jan and opptype should be any of A, B, C, D … If all these are true then sum of X, Y, Z fields else 0 and if any of the x, y, z is null take zero…

I tried the ifelse function but couldn’t sort it out.

Ifelse( dt= A and opp= won and… , Sum(), 0)

Another issue within this:
To pass the month condition

Extract (‘MM’ ,(Date field))

Will this work inside the ifelse?

Hi @Monish

Below is the sample calculation, to check multiple conditions and also include month part from date field.

ifelse(Industry=‘Communications’ and Product=‘ChatBot Plugin’ and extract(‘MM’,{Adjusted Order Date})=03 ,Sales+Profit,0)

Right most column “ifelse-calc” is the result of above calculation.

Let us know if this helps ?

What is the datatype=actuals check ? are you trying to build calculation based on field type?

1 Like

Hi @Ashok . Thanks for the response.
Datatype= ‘actuals’ is similar to industry=‘communication’…

A part of the query is solved.
The next part is …
Suppose for the product you have like

Lets consider
Product = chatbox plugin
Product = xxxxx
Product= yyyy
I tried adding a in() function

The error was in() should have 2 arguments instead of 4 arguments

Hi @Monish

I have tried below calc and its working good to check multiple products using “In”

ifelse(Industry=‘Communications’ and in(Product,[‘ChatBot Plugin’,‘Big Ol Database’]) and extract(‘MM’,{Adjusted Order Date})=03 ,Sales+Profit,0)

Can you try this ?


Thanks @Ashok. This worked … Thanks a lot.