Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts

Friday, March 30, 2012

I don't want my cube to sort my measures and dimensions alphabetically

My cube has multiple measures and dimensions, and I want them to show in the field list of my pivot table in a specific order. However, when I preview them in BI Development Studio Browser, it automatically sorts in alphabetical. I don't want Analysis Service to reorder my measures and dimensions. Is there a way to diable the sorting feature of SSAS?

I'm afraid it's not possible:(. Oledb specification explicitly states that measure schema rowset (same true for dimensions) are sorted by name.

http://msdn2.microsoft.com/es-es/library/ms126250.aspx

You can try (and I have not tries this approach myself) to name dimensions and measures so, the form a specific order and give captions that are what you want your user to see. The more I think about this approach the less I like it.

Friday, March 9, 2012

i am having an issue with my trigger code

i am having an issue with my trigger code
i believe that i should be able to use the multiple if else statements
and i just threw in an update in each begin end statement
but when i check the syntax it fails

any reason why that is
CREATE TRIGGER [tr_update_conveyor_interface] ON [dbo].[t_conveyor_interface]
FOR UPDATE
AS

declare
@.id integer,
@.barcode varchar(25),
@.epc_tag varchar(24),
@.reject_flag char(1),
@.hold_flag char(1),
@.pe_3_flag char(1),
@.old_id integer,
@.old_barcode varchar(25),
@.old_epc_tag varchar(24),
@.old_reject_flag char(1),
@.old_hold_flag char(1),
@.old_pe_3_flag char(1)

select @.barcode = c.barcode,
@.id = c.id,
@.epc_tag = c.epc_tag,
@.reject_flag = c.reject_flag,
@.hold_flag = c.hold_flag,
@.pe_3_flag = c.pe_3_flag
from t_conveyor_interface c
inner join deleted d
on c.barcode = d.barcode

select @.old_barcode = c.barcode,
@.old_id = c.id,
@.old_epc_tag = c.epc_tag,
@.old_reject_flag = c.reject_flag,
@.old_hold_flag = c.hold_flag,
@.old_pe_3_flag = c.pe_3_flag
from t_conveyor_interface c
inner join inserted i
on c.barcode = i.barcode

if(@.old_epc_tag <> @.epc_tag)
begin
update t_load_audit
set id = 1
end

else
if(@.old_reject_flag <> @.reject_flag)
begin
update t_load_audit
set id = 1
end

else
if(@.old_hold_flag <> @.hold_flag)
begin
update t_load_audit
set id = 1
end

else
if(@.old_pe_3_flag <> @.pe_3_flag
begin
update t_load_audit
set id = 1
endNevermind, I got it