Quantcast
Channel: SCN : Unanswered Discussions - Semantic Layer
Viewing all articles
Browse latest Browse all 1291

Optional prompt and case when

$
0
0

Hi Experts,

 

How to select the 0MOVETYPE also from below query

 

SELECT "0PLANT", "0MATERIAL",

       (case when sum(case when "0MOVETYPE" = 602 then 1 else 0 end) > 0

             then max(case when "0MOVETYPE" = 602 then "0PSTNG_DATE" end)

             when sum(case when "0MOVETYPE" = 601 then 1 else 0 end) > 0

             then max(case when "0MOVETYPE" = 601 then "0PSTNG_DATE" end)

             when sum(case when "0MOVETYPE" = 102 then 1 else 0 end) > 0

             then max(case when "0MOVETYPE" = 102 then "0PSTNG_DATE" end)

             when sum(case when "0MOVETYPE" = 101 then 1 else 0 end) > 0

             then max(case when "0MOVETYPE" = 101 then "0PSTNG_DATE" end)

        end) as Last_Sales_Date

FROM "NM1"."PUBLIC"."IZDSO_DMR"  Table__1

Where Table__1."0CALMONTH"  <=@Prompt('Enter YYYYMM','N',,Mono,Constrained,Not_Persistent,,User:-1,(CAST((Concat(CAST((YEAR(Table__1."0PSTNG_DATE")) AS VARCHAR) ,CAST((MONTH(Table__1."0PSTNG_DATE")) AS VARCHAR))) As INTEGER)),Optional)

Group By "0MATERIAL", "0PLANT"

 

 

optional promt also not giving any value if i do not give any input.

 

Please help on this.

 

Thanks,

G Sampath Kumar


Viewing all articles
Browse latest Browse all 1291

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>