3 Replies Latest reply: Jul 4, 2016 9:17 AM by Yeo Poh sai RSS

    How to have SET expression if not select any date it will display YTD amount Jan till july amount , if select year=2016 and month =12 it will display Jan till Dec Amount ?

    Yeo Poh sai

      Hi All



      I have Below expression (A) work fine :-



      Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/Rate)



      I like above expression when using in QS , user don't need to select any month and year , it will display YTD amount.





      After using above expression , user compliant that now when they need to view the Jan till Dec 2016 amount , (when i click on blue button , it does not able to display any value.)



      So i change the above to expression (B) sa below, By remove sales = {'*'} from above expression.





      Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}>} month))"}>}sales_target/Rate)





      Now my issue is if i using the above Expression B in QS , when user log in to the page , they need to select month = 6 and year = 12 in order to view the YTD target amount.



      it there any short cut that allow me when not select any date , it will display YTD target , when select month =12 year = 2016 , it will display sales target from jan till dec amount ?