How can I change my SQL to create the Object? I guess I need to create a measure object that calculate the sales revenue MTD and YTD, not a date object.
I tried the samething. But I am getting wrong results. Do I need to use any @prompts here? I am getting same results for MTD and YTD and also they are not correct results.
If you don’t use a prompt, then how will the user provide the date for the report?
What sort of where clause do you have? If you are getting the same results for MTD that you get for YTD then I suspect that you have the wrong where clause on your query.
It would help if you posted an example of your SQL statement. The entire statement, select, where, and so on.
SQL is code, not data. The reason I asked to see the code is when you put MTD and YTD and other potential objects together, they need to work with each other, not against. You said that you got the same result for MTD that you did for YTD, which tells me they’re not working together properly.
If you’re not going to show code or provide a more detailed explanation as to what you’re doing, it’s going to be hard to help.
If you want to base your MTD and YTD on a start / end date from the user, then you have to reference the prompt in the object in the universe.