Quantcast
Channel: SQL Server Analysis Services forum
Viewing all 14337 articles
Browse latest View live

update query

$
0
0

DECLARE@OriginalTable TABLE(serialNo INT IDENTITY(1,1),Itemcode CHAR(4),Expirydate DATETIME,qty INT,avgprice INT)INSERT@OriginalTable SELECT'A','2013-12-15 10:09:59.237',9,100INSERT@OriginalTable SELECT'B','2013-12-14 10:09:59.237',19,1000DECLARE@DataImported_Excel TABLE(Itemcode CHAR(4),varientqty INT)INSERT@DataImported_Excel SELECT'A',10INSERT@DataImported_Excel SELECT'B',20--before updateSELECT*FROM@OriginalTableUPDATE A SET A.qty = B.qtyFROM@OriginalTable AJOIN@DataImported_Excel B ON A.Itemcode = B.ItemcodeHere I have duplicated Itemcode based up on the expirydate. So I want to update the top expirydate itemcode of originaltable

so kindly alter the above update query--after updateSELECT*FROM@OriginalTable


AK


Sets in SSAS based on selected Value in Slicer

$
0
0

Hi

I have a situation in which , I need to show the 4 week in the column based on the slected value on the slicer. For example , IF user select week48 on slicer.. then my table should show the value of measer for week45,week46,week47,week48.

I tried this by creating sets in SSAS using currentmember of date hierarchy But when I use date hierarchy then excel doesn't allow me to create slicer based on date hierarchy.

Thanks in advance..


lntinfotech

Update Query

$
0
0

I have two table

Table 1 as Stock

SerialNo,ItemCode,Expirydate,qty,avgprice

eg:

Slno  Itcode     dateqty  avgprice

11001 02-01-201310 50

21001 02-01-20135 30

3      100203-01-2013660

41003        04-01-2013      7     80

Tabl2 as StockExcelimp

ItemCode,varientQty

eg:  1001    10

       1002     5

I want Query for update qty of Stock with varientQty (ie  qty+varientQty ) by joining two table. But the problem is 

Itemcode 1001    I have duplicated entry in  Stock  table. So need to update all same itemcode (1001), only update 

the record that is serial number top(max or min) which is correspond to 1001. 

Can any one make a query for it. 


AK

MDX:Work with date in ssas cube

$
0
0

Hi Dears.

as you see my data (by date format ) in data warehouse is correct but when i deploy cube in SSAS 2008 , the data is corrupted.

Please help me as soon as possible.

I have deliver the project sooner.

Thanks

Update Query with Join

$
0
0

select * from S_products where Serial in 
(
select Max(serial)as Serial
FROM S_products A where StoreCode='DEIRA' and ItemCode in (select ItemCode from PUBS..DEIRAVARIANCE16122013) group by ItemCode
)

the above Query result I am getting results

Serial,ItemCode,qty,abgprice 

Now I want to update qty= qty+varientqty

Another Table : StoreExcel, It has ItemCode,varientqty

So I want to Join the abov atable with abov query and update the qty corresponding to itemcode

Please format tht query


AK

Improving performance of a DAX formula containing DIVIDE function - SSAS 2012 Tabular

$
0
0

Hi,

I'm working with a fact table having 150-200 millions of rows and I'm using this DAX formula:

CALCULATE (
        DIVIDE (
            SUM ( FACT_TABLE[Val_A] ) - SUM ( FACT_TABLE[Val_B] );
            SUM ( FACT_TABLE[Val_A] )
        );
        FACT_TABLE[FLAG] = "1"
)

When I try it with an Excel pivot table I've noticed a time over 5-6 seconds to change a filter/slicer selection.

I ask me if it is possible to improve the formula performance, in particular referencing to the DIVIDE calculation.

Any helps to me, please? Thanks

SSAS .abf file without partitions of fact table

$
0
0

Hi All,

I am trying to take a cube .abf file from Dev env. This cube contains patitions for month on one of the fact table. our each env has differnt number of months.

My problem is when i take .abf file from DEV backup it contains only 4 months of data so it as only 4paritions. But SIT conatins 8 months data they are not showing up even after full cube process. i came to know that we must take a fresh .abf file without processing. How can i take it??

Note: I cannot create partions from SSMS.

Thanks in advance

SSAS using datasource at query time

$
0
0

I have a set of reports that run against the cube.  The cube has proactive caching enabled.  If the datasource within the SSAS database has invalid credentials, queries against the cube will not run.  Note: SSAS is setup to run as network service rather than a domain account (temporary situation).

My understanding of MOLAP is that the data is stored within the cube an no access to the source (sql server datamart) is needed for the user to run queries against the cube.  Now this is proving to not be true... leaving me feeling like I don't know what is going on at all.  After 7 years using SSAS I'm finding out that the user's queries don't actually run against the cube, they require that ssas be able to connect to its source data to satisfy the query???!?!?!??!?

I really really don't understand this, but I have tested repeatedly and when I set the datasource to invalid credentials, report queries won't run or just return 0's.  Earlier we were getting 08001 "can't connect to server" messages, now I'm just getting all 0's on the reports when the datasource credentials are invalid.

Just to make this 100% clear, I am talking about the SSAS datasource within the SSAS database, not the SSRS datasource that points to the cube.  Has anyone ever seen this before?  To make it more confusing, now it seems to be working in excel regardless but SSRS still needs the valid datasource.

Thanks,

Ken


Accessing SSAS Cubes with Excel - Parameter Question

$
0
0

I have a cube built that can be accessed through Excel.  Connection and data is good but I have a question regarding parameters.  I want to the end user to be able to choose a date that will sum a measure from the 'beginning of time' to the date chosen.

Below is part of the mdx script that I have prepared.  The date is currently hard-coded for testing purposes but again I want the user to be able to choose the date.

SUM({NULL:[Dim Date 1].[CALENDAR].[full date].[2013-06-21 00:00:00.000]},[Measures].[EVENT])

When trying to achieve my objective from above, should I be creating a calculated member in SSAS or create it on the Excel side?  If SSAS, then how would the parameter be passed from Excel into the calculated member?

Suggestions are helpful.  

Thanks. 

Simple sql to mdx query

$
0
0
select MAX(InsertionDT),TaskStatus,tasksubstatus from TransTasksFFMS_GVT where TaskCode =323155groupby TaskStatus,tasksubstatus 

To use this query in the cube browser I have created a name query and used it as a dimension and it works, however I'm asked to do the calculation as a measure. Is it possible to translate this query to mdx to use it as the expression in a calculation?

What the query does: Returns the max insertion date for a each pair of status and sub status.

I'm new to MDX and to the whole cube idea!

Calculation with YTD not working

$
0
0

Hello everybody,

I try to create a calculated measure in my cube to show a YTD value but in the browser I only got the error #VALUE!.

This is the expression of the calculated measure:

What could be wrong?

Kind regards

Lars

Distinct Count Calculation

$
0
0

Hello everybody,

I have a cube with appointments including dimensions for companies and dates.

One of my measures is "Appointments" which is the count of all appointments. Another calculated member is "Visits" which is the count of appointments with the type of "Visits".

This is my MDX epxression for "Visits":

AGGREGATE([Appointment].[Type].&[Visit], [Measures].[Appointments])

Now I would like to create a new calculated member "Company Visits" which should be the distinct count of "Visits" by company and date.

Example: 2 "Visits" in one company on the same day should be 1 "Company Visit"

In T-SQL this query works:

COUNT(
   DISTINCT(
      CASE [Type]
         WHEN "Visit" THEN CAST([CompanyID] AS NVARCHAR) + CONVERT(NCHAR(8), CAST([Date] AS NVARCHAR))
         ELSE NULL
      END
   )
) AS [Company Visits]

How can I do this with MDX in calculations?

Additionally I would like to have a calculated member "Days in Field" as distinct count of dates with "Visits".

Thanks in advance and best regards

Lars


Using IF or SWITCH functions inside a DAX formula into a tabular model - SSAS 2012

$
0
0

Hi,

in a tabular model I've changed a DAX formula introducing the SWITCH function, but when I deploy the changed formula and open the Excel workbook the slicer connected to the pivot table doesn't highlight the slicer values involved as instead of old formula.

Any suggests to me in order to maintain the right behaviour for the slicers when a formula is re-written using an IF/SWITCH functions, please?

Thanks

Difference between these two in deny permission

$
0
0

When you do some deny permission to get access to the data, why does SSAS has one cube and the rest is dimensional table before processing to make deny access. What is the different?

Display Limited value of Measurement for Salesman

$
0
0

Goal:
Make a limition of the measurement "Internet Sales Amount" value to 14545058,5455 without using any dimension table. The sales man is not allowed to view the whole value of mesurement "Internet Sales Amount". Only allowed to view limited of data in "Internet Sales Amount".

Problem:
I have problem to make a limitation of the measurement "Internet Sales Amount" that shall be access for Excel and SSRS.


SSAS - Named Set Grand Total

$
0
0

Hi,

I have a Calculation which I need to compute on fly. Index is the measure which will be product of Base Measure A and B divided by Sum(Measure A ofselected Dimensions as shown in grey). I created Named set (Descendants) but had some difficulty in getting Total Measure A categorized based on selection.

Please help me with calculated measure MDX script for the same for below output. Also the calculation script should work if just Product and Year are alone selected.

SSAS - Calculated Measure

Thanks in advance,

Paddy


Difference between denying permission to cube dimensions and database dimensions in SSAS

$
0
0

When you are denying permissions to users in a role in SSAS, you have the option of denying permission to the cube dimension or the database dimension. What is the difference between these two?

filter out measures with 0 as value

$
0
0
In SSAS cube browser,  is there a way to filter out rows where the measure value is zero?  For example, I have a Location dimension and a remaining inventory measure.  Is it possible to not display the rows where the remaining inventory value is 0 for the location?
John Schroeder

SSAS Date Dimension attribute not displaying all members when browsed singly

$
0
0

I have an SSAS Cube database that holds data from 2009 to 2013 (5 years)

There is a Date Dimension in the database which holds a "Calender Period" Hierarchy with the attributes CalenderYear >> Quarter >> MonthYear >> Day .

I am connecting to the cube via Microsot EXCEL

Whenever i try to browse this hierarchy alone in the spread sheet, the first attribute as per the hierarchy shown above i.e. Calender Year does not display all the members, that is confusing the users to assume that the cube is not processed with the latest data, which is not the case. However as soon as i try to browse any measure with this dimension, the data automatically shows for the latest dates of 2013 as per the expectations.

The perspective that is selected while connecting to the Cube in this case is the one that is by default the one including all the Cube Objects.

Whenever i try to browse the same cube for the same Dimension Hierarchy but in a separate user perspective i get the latest three Calender Years i.e. 2011,2012 and 2013 but not the complete years 2009 to 2013.

When i was browsing this earlier by the original base perspective (which has all the cube objects visible) the Calender Years displayed were 2009,2010,2011&2012 but not 2013 which should be there.

I checked the base view in the DB that is used to create this Dimension, that is fetching the complete data for 2009 to 2013.

I have also verified that this issue is still there if i try to browse the cube from the SSMS.

Can anyone help me to get all the years from 2009 to 2013 (the years for which my cube has data) become visible as soon as i drop it alone into the Spreadsheet?

Thanks 

Suvrat

How Can Use varchar measures in cube

$
0
0

Hi Dears

Please help me as soon as possible.

I define a Named Query on 3 dimension tables .the miladidate field as a date and the MonthName field as a varchar, do not display in cube browser.

how can i do???????????

Viewing all 14337 articles
Browse latest View live


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