Prompt for creating condition

Is there a way a prompt can be created with the following values…
…>
…=
…<
…<=
…>+
…<>

Then take this and use it to resolve another Prompt?


ystu15 (BOB member since 2011-02-10)

What is >+ ? All of those other ones can be part of a prompt that you create in the query filters. However, I don’t think a query prompt can transfer to another query prompt. You can only use the results of one query (the data) in another query.


BrianVT (BOB member since 2016-03-03)

Sorry, supposed to be >=

But yeah, depending on what condition the user selects I need to take that symbol and apply it to another prompt…

Prompt:
Balance Object is (>, =…) Amount Object


ystu15 (BOB member since 2011-02-10)

You could build it all into one big case statement?

Not sure how would you do that. I mean the user will have the option of selecting > < = or any of the others.

I thought of setting something up in the Universe but then I will need to get that value to apply it.
I heard of Cascading Prompts, maybe that would work!?
Never did this


ystu15 (BOB member since 2011-02-10)

Yes, universe object.

Something like:

SUM(
CASE WHEN @Prompt("Select an operand".....) = ">=" Then F_Sales.SalesValue Where F_Sales.Quantity >= @Prompt("Please enter quantity threshold".....) 
WHEN @Prompt("Select an operand".....) = "<=" Then F_Sales.SalesValue Where F_Sales.Quantity <= @Prompt("Please enter quantity threshold".....) 
......
END)

Just cut and paste your two prompts so that you have one operand prompt and one sales quantity prompt appear in your query (you can test it in UDT with Query Builder).

Looks interesting; will give it a shot and let you know.

Thanks Mark!


ystu15 (BOB member since 2011-02-10)

I gave it a try and played with it for a while but keep getting an error. Latest error I am receiving is Syntax near WHERE ?

CASE WHEN @Prompt(‘Select an operand’,‘N’,) = “>” Then Table.Balance WHERE Table.Balance > @Prompt('Please Enter Amount ',‘N’,)
WHEN @Prompt(‘Select an operand’,‘N’,) = “<” Then Table.Balance WHERE Table.Balance > @Prompt('Please Enter Amount ',‘N’,)
END

:?:


ystu15 (BOB member since 2011-02-10)

I think I fixed it :slight_smile:


ystu15 (BOB member since 2011-02-10)