New Named Calculation in SSAS DSV

19
31980
New Named Calculation
New Named Calculation

Friends,

Named calculations are Virtual columns that can be added on tables in Data Source View(DSV). This named calculation acts as a Column in your table and this column won’t be reflected in your database. If you wish to extend the relational schema of a table or a view without modifying the underlying data source table or view then New Named Calculation is the correct option. One more and main advantage of “Named Calculation” is that these are calculated at the time of PROCESSING but not at QUERY Time and hence the performance will be good. The Named Calculation consists of the following things.

1) Name – Name of the Virtual Column

2) Description – Description about the Virtual Column(Optional).

3) Expression – Valid SQL Expression.

You can use one or more columns to define the expression for Named Calculation. For example to get full name as a new virtual column we have to use the below expression.

Title+’ ‘+FirstName+’ ‘+MiddleName+’ ‘+LastName

The above expression is using four columns to define Full Name Virtual column. PFB the steps to be followed to create the named calculation.

1. Right-click the table and select Create a named calculation.
2. Enter the calculation name as “Full Name” and enter a description.
3. Enter the following expression:

Title+’ ‘+FirstName+’ ‘+MiddleName+’ ‘+LastName

New Named Calculation
New Named Calculation

4. Once the OK button is clicked it will show if there are any errors in syntax. If there are no errors then you can see new Virtual column named “Full Name” with an icon “CALCULATOR” next to it as shown in below screenshot.

5. If you wish to test whether you are getting data as expected or not then you can you “EXPLORE DATA” option as shown in the below screenshot.

New Named Calculation
New Named Calculation

This is how you can use calculations. If you use the same expression which is given above to concatenate columns then you may not get desired result if we have NULLs in data. For example if Last Name is NULL for a column the <Some Value> + NULL is treated as NULL by SQL and hence we have to handle NULLs in expressions when we are working with String data. PFB the updated query which handle NULLs.

isnull(Title,”)+’ ‘+isnull(FirstName,”)+’ ‘+isnull(MiddleName,”)+’ ‘+isnull(LastName,”)

In the above expression I am checking whether the value is NULL or not and if it is NULL then I am replacing it with ‘BLANK Value.

Note – It is not mandatory that you have to use at least one column from table to create an Expression. The following are also Valid Expressions.

1) getdate()

2) 1 or any integer

3) ‘Dumy’ or any string

In short any valid SQL expression can be given as Named Calculation Expression.

That’s it and Happy Coding !

Regards,

Roopesh Babu V

 

19 COMMENTS

  1. Waking up too early in the morning, not being able to fall asleep, or sleeping too much can all be symptoms of depression.
    Getting the real deal at sildenafil online at rock bottom prices
    Psychiatrists as a whole remain amazingly ignorant regarding neurotoxicity in general, especially mold toxicity.

  2. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали ремонт фотоаппаратов canon рядом, можете посмотреть на сайте: ремонт фотоаппаратов canon сервис
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  3. Предлагаем услуги профессиональных инженеров офицальной мастерской.
    Еслли вы искали ремонт фотоаппаратов canon цены, можете посмотреть на сайте: ремонт фотоаппаратов canon адреса
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  4. Vibracion del motor
    Aparatos de calibración: importante para el funcionamiento suave y productivo de las dispositivos.

    En el entorno de la ciencia contemporánea, donde la rendimiento y la fiabilidad del equipo son de máxima significancia, los sistemas de ajuste cumplen un tarea esencial. Estos aparatos específicos están diseñados para calibrar y asegurar elementos móviles, ya sea en equipamiento productiva, automóviles de transporte o incluso en dispositivos hogareños.

    Para los expertos en mantenimiento de sistemas y los técnicos, utilizar con aparatos de balanceo es importante para asegurar el desempeño fluido y estable de cualquier dispositivo dinámico. Gracias a estas alternativas avanzadas modernas, es posible limitar notablemente las oscilaciones, el ruido y la presión sobre los cojinetes, extendiendo la tiempo de servicio de componentes costosos.

    Igualmente trascendental es el función que cumplen los aparatos de equilibrado en la servicio al comprador. El soporte experto y el reparación permanente aplicando estos aparatos habilitan dar soluciones de excelente nivel, elevando la contento de los compradores.

    Para los propietarios de proyectos, la contribución en unidades de equilibrado y medidores puede ser fundamental para incrementar la efectividad y desempeño de sus aparatos. Esto es particularmente importante para los emprendedores que dirigen medianas y pequeñas empresas, donde cada detalle es relevante.

    Además, los dispositivos de equilibrado tienen una gran utilización en el campo de la seguridad y el monitoreo de excelencia. Habilitan localizar potenciales errores, evitando arreglos costosas y perjuicios a los aparatos. Además, los datos generados de estos dispositivos pueden utilizarse para perfeccionar procesos y potenciar la exposición en sistemas de consulta.

    Las áreas de aplicación de los dispositivos de calibración comprenden numerosas ramas, desde la producción de transporte personal hasta el monitoreo ambiental. No interesa si se habla de enormes elaboraciones manufactureras o reducidos locales hogareños, los dispositivos de balanceo son necesarios para proteger un funcionamiento productivo y sin interrupciones.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

fifty three + = fifty eight