Skip to main content
Solved

Lobby Data Source Designer: Column As not allowed


Forum|alt.badge.img+10
  • Sidekick (Customer)
  • 119 replies

Trying to sort a column by order process and not alphabetically for a Lobby and it doesn’t like the as Status format.

The similar quick report works fine.

Is this not possible in a Lobby?

 

case when state = 'Blocked' then '1 - Blocked' when state = 'Planned' then '2 - Planned' when state = 'Released'  then '3 - Released' when state = 'Reserved'  then '4 - Reserved' when state = 'Picked'  then '5 - Picked' when state = 'Partially  Delivered'  then '6 - Partially Delivered' when state = 'Delivered'  then '7 - Delivered' end as Status

 

Quick report has desired seqeunce:

 

Lobby is currently alphabetically:

 

Best answer by SANJ

Hi,

If you want to display the column value as same as your quick report then you can use case statement and don't use “as status” suggested by Paul and use the order by value as

decode(state,'Blocked',1,'Planned',2,'Released',3,'Reserved',4,'Picked',5,'Partially  Delivered',6,'Delivered',7) in order by clause

 

View original
Did this topic help you find an answer to your question?

10 replies

paul harland
Superhero (Employee)
Forum|alt.badge.img+24

you should not need “as status” here

just put the rest of the text (up to “END”) into the column, and then name it.


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 119 replies
  • September 21, 2020

thx for your reply. I tried that but then the Order by doesn’t work and I get an error:

 

 


Forum|alt.badge.img+6
  • Sidekick
  • 12 replies
  • September 21, 2020

Hi Bob,

No need to use case statement in the state column to display but use order by as below,

in the order by clause,
decode(state,'Blocked',1,'Planned',2,'Released',3,'Reserved',4,'Picked',5,'Partially  Delivered',6,'Delivered',7)

Thanks,
Sanjay


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 119 replies
  • September 21, 2020

Thx for the idea. However that code merely replaces the text for a number; I need for it to be sorted on my case results text; not the DB status value- see my 1st print screen in my original post. Blocked, Planned, Released, etc...

 

 


durette
Superhero (Customer)
Forum|alt.badge.img+19
  • Superhero (Customer)
  • 525 replies
  • September 21, 2020

ORDER BY columns don’t get AS aliases in SQL. However, if we’re working in pure SQL without a middle application trying to interpret it, you can do an ORDER BY on the alias itself: ORDER BY status


Forum|alt.badge.img+6
  • Sidekick
  • 12 replies
  • Answer
  • September 21, 2020

Hi,

If you want to display the column value as same as your quick report then you can use case statement and don't use “as status” suggested by Paul and use the order by value as

decode(state,'Blocked',1,'Planned',2,'Released',3,'Reserved',4,'Picked',5,'Partially  Delivered',6,'Delivered',7) in order by clause

 


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 119 replies
  • September 21, 2020

thx for the explanation. So this can’t be done in a Lobby, correct?

 

 

 


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 119 replies
  • September 21, 2020

 


Forum|alt.badge.img+6
  • Sidekick
  • 12 replies
  • September 21, 2020

Hi,

 

This can be done in Lobby.

Please use the case statement in the columns section and the order by decode expression which I have mentioned above in the order by clause section in lobby or also you can use the same case statement in order by clause.


Forum|alt.badge.img+10
  • Author
  • Sidekick (Customer)
  • 119 replies
  • September 21, 2020

ok, thx. it works! I misunderstood your solution- once I put the decode) code in the Order by it worked.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings