Need Help on Refresh function in .net for overrides the M expression in SSAS Tabular model.

%3CLINGO-SUB%20id%3D%22lingo-sub-369369%22%20slang%3D%22en-US%22%3ENeed%20Help%20on%20Refresh%20function%20in%20.net%20for%20overrides%20the%20M%20expression%20in%20SSAS%20Tabular%20model.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369369%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20help%20on%20the%20below%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFunction%20in%20.net%20for%20Overrides%20the%20M%20exrpression%20In%20partition%20of%20the%20Table%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Epublic%20void%20Refresh(RefreshType%20type%2C%20ICollection%3COVERRIDECOLLECTION%3E%20overrides)%3B%3C%2FOVERRIDECOLLECTION%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Epublic%20void%20RequestRefresh(RefreshType%20type%2C%20ICollection%3COVERRIDECOLLECTION%3E%20overrides)%3B%3C%2FOVERRIDECOLLECTION%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20above%20two%20functions%20are%20not%20working%20for%20override%20the%20old%20M%20expression%20for%20Paritition%20query%26nbsp%3B%20with%20New%20Expression.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20used%20the%20override%20class%20then%20we%20refresh%20with%20above%20functions%20unfortunately%20it%20is%20not%20updating%20the%20in%20the%20Expression.%26nbsp%3B%3C%2FP%3E%3CP%3ECode%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETOA.Partition%20partition%20%3D%20m.Tables.Find(Table).Partitions%5B1%5D%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOverrideCollection%20oc%20%3D%20new%20OverrideCollection%7B%3C%2FP%3E%3CP%3EPartitions%20%3D%7B%3CBR%20%2F%3Enew%20PartitionOverride%7B%3C%2FP%3E%3CP%3EOriginalObject%20%3Dpartition%2C%3CBR%20%2F%3ESource%20%3D%20new%20MPartitionSourceOverride%3CBR%20%2F%3E%7BExpression%3Dexpressions%7D%7D%7D%7D%3B%3C%2FP%3E%3CP%3Evar%20listOc%20%3D%20new%20List%3COVERRIDECOLLECTION%3E()%3B%3CBR%20%2F%3ElistOc.Add(oc)%3B%3C%2FOVERRIDECOLLECTION%3E%3C%2FP%3E%3CP%3Epartition.RequestRefresh(TOA.RefreshType.Add%20%2ClistOc)%3B%3C%2FP%3E%3CP%3Epartition.Refresh(TOA.RefreshType.Add%2C%20listOc)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ESanthosh.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-369369%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.NET%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eanalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EData%20%2B%20Storage%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi,

 

I need help on the below issue.

 

Function in .net for Overrides the M exrpression In partition of the Table .

 

public void Refresh(RefreshType type, ICollection<OverrideCollection> overrides);

 

public void RequestRefresh(RefreshType type, ICollection<OverrideCollection> overrides);

 

The above two functions are not working for override the old M expression for Paritition query  with New Expression.

 

We used the override class then we refresh with above functions unfortunately it is not updating the in the Expression. 

Code:

 

TOA.Partition partition = m.Tables.Find(Table).Partitions[1];

 

OverrideCollection oc = new OverrideCollection{

Partitions ={
new PartitionOverride{

OriginalObject =partition,
Source = new MPartitionSourceOverride
{Expression=expressions}}}};

var listOc = new List<OverrideCollection>();
listOc.Add(oc);

partition.RequestRefresh(TOA.RefreshType.Add ,listOc);

partition.Refresh(TOA.RefreshType.Add, listOc);

 

 

Thanks,

Santhosh.

0 Replies