Tuesday, 7 February 2017

Wave 112: XMD - Extended Metadata

Extended metadata --> XMD 
How to change formatting and other factors using XMD.  
For making changes using XMD you need to use a utility on Github. Datasetutils-32.x.x is what its called.  
The zip file has run.bat for windows users.  
Open and use the same credentials as your org. Sign in to app and you can see the dataflow list, file upload, process monitor and XMD.  
Click the actions on a dataset and edit XMD. 
You can see the json now.  
There are key value pairs like JSON.  
The one of the right is the label and the left value is the API Name.  
If you want to change the Labels you can change the XMD and look at the data set you can see the changes reflected there.  


It will show the errors on run time with an x on the side bar in red.  
When you click submit XMD you can see if it worked successfully.  
You can rename measures just like renaming dimensions.  
Date is splits in different grains of time.  
The composite date dimension combines all the grains of time and gives on value of time.  
Let us say you are extracting 50-60 users from the system, you want the end user to see only a few. You can do this from the XMD.  
Use "hide_dimensions":[api names of the dimensions you want to hide in quotes] 
Click submit xmd and you will see the change.  
Using xmd you can format values on a dashboard.  
Go the section named formats.  
Go to the measure you are interested in.  
It takes 2 parameters  
"$",##0.00" 
This means you want to see the value from  
30000 to $30000.00 
How to add formatting to a derived measure? 
YoY [#,##0.00"%"] 
We can relabel the values for dimensions using XMD. We can give colors for that also. Below is given how it is done.  
Go to the colors and give for 0 and 1.  
To rename 0 and 1 use  
Cancelled here is the dimension name. 
"keys":{ 
"Cancelled":{ 
"0":Yes 
"1":No} 
} 
Value query columns  



Wave 111: Data

 How to load data into wave? 
Create button and choose dataset 
Shows the data source which is salesforce or CSV 
We can use ETL partners to load data into wave as well.  
When you choose CSV format you can select the data and it creates a json file.  
What are the dimensions and the measures? 
Dimension, measure and date are the three data types.  
It says the dataset will get created in an hour. 
Always double check your data for dimensions and measures.  
Dimension in deep blue, measure in purple and date is light blue.  
Before doing a create dataset run the preview of it so that you are able to verify this.  
You can go to the data monitor and look at the data flow view and the job view. The data monitor is in the settings. Shows how your datasets were uploaded or not.  
Uploading data is through a data scheduler and that’s why they tell that it may take time. There is a data queue. 
Upload data in the csv format and make sure measures and dimensions are correctly identified. A dimension with only numeric values might be considered as a measure. Change it. The date format is sometimes not properly recognized, you can make sure that in excel its properly recognized.  
When pulling data from Salesforce, we will be using a GUI builder with custom and standard objects accessible by the REST API. 
On the dataset builder,  you can click the object and choose the fields. Go to relationship and click join to add the related objects and attributes. It looks like a snowflake schema as you add/join more and more related objects. 
They create nodes in the dataflow. 
You can see the JSON Payload as well if you want. This helps you create a denormalized dataset with the relationships.  
We can schedule the datasets by choosing the time/schedule time. It looks much like a simplified version of informatica workflow monitor in informatica powercenter. 
After creating the dataset, if you open and look at the grouping, you will be able to see the related object fields in the grouping as well. You will be able to see it in the format relatedobject.fieldname 

Wave 110: SAQL Beyond Foundation

Each query fires a remote in the network console.  
Selection binding prevents hard coding.  
Do not access the dataset by id and version id. It will lead to a particular version. Instead refer to the alias of the dataset.  
To query multiple datasets at one point of time you need to use the SAQL format. 

Wave 109: SAQL

Open network console and fire a query and notice changes in the network console.  
SAQL tester github. The first link is the SAQL tester.  
Drag the salesforce analytics cloud SAQL tester to the bookmark. If it asks you to be logged in to be able to access the bookmark, your bookmark is installed properly. 
You can paste the code on the SAQL editor and see the data tables in the output column.  
Biggest difference between SAQL and SQL you need a generate statement to get an output, else an error would pop up. Reason is that it is quering a non relational database much like Apache Pig™. 
Product documentation gives more context on SAQL.  
Steps in the JSON are generally powered by the compact form. To power using SAQL you need to  go to the Network Console and copy the Request payload source.  
You get a JSON payload on the POST command which is sent from the client to the server.  
To power the JSON by SAQL you need to add a command "pigql" and add the query  in the query block. The legacy name for SAQL is pigql 
When the query is now run it is powered by the pigql/SAQL step but the same dashboard is seen. When the pigql/SAQL is present, only this is fired and the compact form is not being run.  
The compact form parameters are still needed at this point in time like measures, groups and filters even though its being passed by SAQL.  

How do I know that the piqgl/SAQL is taking precedence over the compact form? 
Choose the limit value to something else you will notice that the SAQL will run when you add that change in the JSON dashboard.