LOD (Level of Detail) Expressions in Tableau
Types of LOD Expressions in Tableau
- FIXED
- INCLUDE
- EXCLUDE
There are three types of LOD expressions in Tableau:
FIXED: The FIXED LOD expression calculates values based on specific dimensions, regardless of the dimensions present in the visualisation. It creates a virtual level of detail for the calculation. For example, {FIXED [Category]: SUM([Sales])} would calculate the total sales for each category, irrespective of other dimensions used in the visualisation.
INCLUDE: The INCLUDE LOD expression calculates values at the specified level while incorporating the dimension(s) used in the visualisation. It allows you to aggregate data for a specific dimension while considering other dimensions in the visualisation. For example, {INCLUDE [Region]: AVG([Profit])} would calculate the average profit for each region, considering all other dimensions in the visualisation.
EXCLUDE: The EXCLUDE LOD expression calculates values at the specified level while excluding the dimension(s) used in the visualisation. It enables you to aggregate data for a specific dimension while ignoring other dimensions in the visualisation. For example, {EXCLUDE [Product]: SUM([Revenue])} would calculate the total revenue for each product, excluding any other dimensions present.
FIXED LOD Tableau Function
In Tableau, the FIXED Level of Detail (LOD) is the widely used function that allows you to perform calculations using specific dimensions, irrespective of the dimensions present in the visualisation. It creates a virtual level of detail for the calculation, providing precise control over your analysis's granularity.
Steps to Create a FIXED Level of Detail Tableau Function
In Tableau, the FIXED Level of Detail (LOD) function allows you to perform calculations using specific dimensions, irrespective of the dimensions present in the visualisation. It creates a virtual level of detail for the calculation, providing precise control over your analysis's granularity.
The steps to create the FIXED LOD function are as follows:
- • Create a calculated field. (This can be done by clicking on the drop-down next to the “Search” bar in the dimension pane or by selecting “Analysis” and selecting “Create Calculated Field”)
- • Type in the FIXED LOD Formula in the calculated field and drop the field into the view.
- • We can obtain the syntax of the FIXED expressions when we search for “Aggregate” functions in the calculated field.
Example
The following FIXED level of detail expression computes the sum of sales per region:
Beinex+ Tableau Offerings
Beinex has 100 years of combined experience in Tableau and is led by professionals who have successfully delivered Tableau projects in the region for large private and public sector organisations. Our team of Tableau-certified consultants are real-life Tableau business users passionate about Tableau and providing a world-class experience. In addition to providing sustainable analytics solutions, Beinex will help organisations to build superior data visual analytics capabilities internally through our bespoke training programs.
In Tableau, "Level of Detail" (LOD) expressions are a powerful feature that allows you to perform calculations at different granularities within your data. With LOD expressions, you can control the level at which an aggregation or calculation takes place, regardless of the visualisation's dimensions.
Related Articles

Our Top Cloud Engineering Services Include:
• Cloud Consulting • Cloud Security • Cloud Migration & Modernization and more Feel Free to Schedule a Call: https://beinex.com/cloud-engineering
Read More
Beinex Among Top BI Consulting Firms in the Middle East Beinex Ranked as Top Data Science Consulting Firms in the Middle EastAbout Beinex Cloud Services
By partnering with Beinex, a leading cloud engineering and enablement partner in the Middle East, you can leverage our expertise to optimize your cloud infrastructure, enhance performance, and ensure security and compliance. Our technical prowess allows us to design and implement tailored cloud solutions that align with your business needs, enabling you to maximize the benefits of cloud technology and drive innovation.
Partnering with industry-leading cloud technology providers like Google Cloud Platform, AWS, and Microsoft Azure to build scalable, secure, cost-effective solutions and deliver transformative cloud technology solutions. Beinex has also forged strong partnerships with Snowflake, Tableau, Alteryx, Alation, and Databricks. These collaborations enable us to offer comprehensive solutions that leverage the best-in-class capabilities of these platforms. We can provide our clients with cutting-edge technologies and expert guidance by working closely with our partners.
About Consultancy-me
Consultancy-me.com is a premier platform for those seeking to remain informed about the advisory and consulting industry. The website provides a comprehensive array of the latest news and trends across more than 60 industries and functional areas within the consultancy sector. Consultancy-me.com collaborates globally with over 150 prominent consulting firms and organizations.

- Einstein Discovery
- Quick LODs
- More Data Connections
- View Metrics
- Dashboard Extensions in Tableau
- Write to Excel in Tableau Prep
- Device Designer for Web Authoring
- License Improvements
- Through Dashboard Extensions: To use “Einstein Discovery” in dashboards, I can just add an extension object on the dashboard and select Einstein Discovery. It will analyse the selected data and build predictive models. It shows me the top predictors in the view along with metrics that can be improved, and thus helping business decisions. This feature is available in Tableau Desktop, Tableau Server and Tableau Online.
- Through Analytics Extension: With this feature, I can directly embed predictions into Tableau calculated fields. All I have to do is go to Salesforce, use Model Manager to generate a Tableau table calculation script and paste the script into the calculated field in Tableau. This script then accesses predictive models in Salesforce by passing the data required for the model. This saves my time since I don’t need to create a code for the model. This feature is only available in Tableau Desktop and Tableau Server.
- Through Tableau Prep: This feature was released in 2021.1.3 and its ingenuity is worth mentioning. With “Einstein Discovery” in Tableau Prep, I can now use predictions while preparing data. I can bulk score my data and create fields to show prediction outcomes, to show top predictors and to show recommendations for improvement of the output.
Quick LODs
LOD calculations are frequently used in Tableau to perform calculations on a fixed dimension. Where previously I had to mention the dimension to be fixed and the measures to be aggregated in a calculated field, now all I must do is select the dimension and measure in the data pane and right click to create an LOD calculation. Or even better, hold “Ctrl” to drag and drop the required measure field onto the dimension to be fixed. As simple as that.
I can modify the calculation with more dimensions or change the type of aggregation later, if required.
This feature is most beneficial as it reduces the chance of errors while creating complex LOD calculations, like misplacing a bracket, or adding any unnecessary characters by mistake.
More Data Connections
With the increase in popularity of Microsoft Azure services among users, Tableau has added multiple Azure connectors including Azure SQL Database and Azure Data Lake Gen 2 along with the existing Azure Synapse Analytics and Databricks. I can now connect to data that is stored in Azure’s SQL Database and Data Lake using the native Tableau connectors. Tableau has also introduced authentication to Azure services using the Azure Active Directory, making the connection more secure.
In addition to this, four new data connectors have been added to Tableau Online and Tableau Server. They are Amazon Athena, Apache Drill, OData and SharePoint Lists.
View Metrics
A difficulty that I had faced with the metric feature was that I was not able to know the other metrics that were created in the same dashboard. With this update I can see all the metrics associated with a particular dashboard and modify these metrics if required or create new ones within the metrics pane.
And previously, only if my site role were “Creator” or “Explorer”, I could see the metrics. But in this update, I can see all metrics connected to a dashboard irrespective of my site role.
Dashboard Extensions in Tableau
Earlier, to use an extension in a Tableau Dashboard, I had to drag and drop the extension object on the dashboard which would take me to its extension gallery web page and then I had to download it and then locate the downloaded extension on Tableau. Sounds tiring right?
Not anymore! With this update, all I have to do is drag and drop the extension object onto the dashboard to select the required extension. I can now see all extensions and filter the list based on categories within the “Add an Extension” window in the Tableau screen.
Write to Excel in Tableau Prep
This is one feature that will prove useful to any regular Tableau Prep user. The days of exporting an output to csv and then converting it manually to an xlsx file are finally over.
Using the latest version of Tableau Prep, I can directly export the output of a workflow into an xlsx file.
Device Designer for Web Authoring
Where before I could only generate device specific layouts in Tableau Desktop, now I can create custom phone or tablet views within the web itself. I no longer have to modify the device layout in Tableau Desktop and re-publish whenever a change in device layout is required.
Licensing Improvements
With this update, Tableau has introduced zero downtime licensing for the Tableau Server. Now for most of the tasks, whether it is the activation of a license or updating a feature that got added or applying some changes to user capacity, I no longer need to perform a server restart.
So, these are some features that have been helpful to me and these are just a few of the lot. To view all the new features in 2021.1, you can view it at Tableau 2021.1 New Features
In my view, Tableau has done a great job with its timely and inventive updates and seeing the rapid growth of AI and the increase of its application in numerous industries, I can predict for sure that Tableau will surprise the data science community with more innovative updates.
Images Courtesy: Tableau
Here is a list of a few popular business intelligence tools companies use to gain insights:
1.Sisense: Leading Cloud Analytics Platform
Sisense is one of those data analytics and business intelligence tools known for its efficiency and easy-to-use quality. It enables anyone within an organisation to manage massive and intricate datasets and analyse and visualise data without any outsourcing. It also combines data from various sources, such as Adwords, Google Analytics, and Salesforce. The in-chip technology helps it to process data faster than any other tool. Gartner, G2, and Dresner have recognised Sisense as a leading cloud analytics platform.
2.SAP Business Intelligence: Price to the Upside
SAP Business Intelligence offers advanced analytics solutions such as machine learning, BI predictive analytics, and planning and analysis. This enterprise-level client/ server system application provides data visualisation and analytics applications, reporting and analysis, mobile analytics, and office integration.
The platform focuses heavily on Customer Experience (CX) and CRM, digital supply chain, ERP, etc. What's particularly appealing about this platform is the self-service, role-based dashboards, which allow users to create unique dashboards and applications. SAP is a robust software designed for all roles that provide many functionalities on a single platform. However, the product's complexity raises the price, so be equipped for it.
3.Datapine: Accessible to non-technical users
Datapine is a comprehensive business intelligence platform that makes the intricate process of data analytics accessible to non-technical users. Datapine's solution allows data analysts and business users to blend different data sources, perform advanced data analysis, build interactive business dashboards, and create actionable business insights by adopting a comprehensive self-service analytics approach.
4.Dundas BI: Access Multiple Data Sources in Real Time
Dundas BI is a browser-based business intelligence tool that enables users to access multiple data sources in real-time. It offers excellent visualisations in the form of tables, graphs, and charts that can be personalised and viewed on mobile devices and desktop computers. Users can easily create reports and extract specific performance metrics for analysis. Dundas aids all types of businesses and industries.
5.MicroStrategy: Fast Dashboarding in Action
MicroStrategy is a business intelligence tool for enterprises that provides powerful and fast dashboarding and data analytics, cloud solutions, and hyperintelligence. Users can use this solution to identify trends, and new possibilities, increase productivity, etc. It can be accessed via desktop or mobile and can be connected to one or more sources.
6.Yellowfin BI: No-co-Low-co Approach
Yellowfin BI is a business intelligence and analytics platform that combines visualisation, machine learning, and collaboration. It can quickly sort through massive amounts of data using intuitive filtering, and it is accessible from anywhere. This BI tool takes dashboards and visualisations to the next level by utilising a no-code/low code development environment.
7.Qlik Sense: Search & Conversational Analytics
A product of Qlik, QlikSense is a complete data analytics platform and business intelligence tool. QlikSense can be accessed from any device at any time. The user interface of QlikSense is optimised for touchscreen, which makes it a prevalent BI tool. It offers a one-of-a-kind associative analytics engine, sophisticated AI and a high-performance cloud platform, making it more attractive. An exciting feature of this platform is its Search & Conversational Analytics, enabling a faster and easier way to ask questions and discover new insights through natural language.
8.Zoho Analytics: Blend and Merge Data
Zoho Analytics is an excellent BI tool for detailed reporting and data analysis. It supports automatic data syncing and can be scheduled regularly. It quickly creates a connector and formulates meaningful reports by blending and merging data from various sources using the integration APIs. It helps to quickly identify the essential details by creating ersonalized reports and dashboards with an easy editor. It also includes a distinct commenting section in the sharing options, ideal for collaboration.
9.Microsoft Power BI: Identify Trends in Real Time
Microsoft Power BI is a web-based tool that is one of the best for data visualisation. It enables users to identify trends in real-time and includes brand new connectors that allow businesses to step up marketing campaigns. Microsoft Power BI is accessible virtually from any location as it is web-based. This tool is designed to integrate apps and deliver reports in real-time dashboards.
10.Looker: Ideal for SMEs
Looker, a data discovery app, is another business intelligence tool to watch for! This unique platform is now part of Google Cloud and integrates with any SQL database or warehouse and is ideal for startups, midsize businesses, and enterprise-grade businesses. This tool's advantages include its ease of use, useful visualisations, powerful collaboration features such as easy integration with apps, flexible sharing of data and reports via email or USL, and a dependable support system.
11.Clear Analytics: Just Need Essential Excel Skills to Use
Clear Analytics is an easy-to-use Excel-based software that can be utilised even by employees with just the essential Excel skills. It is a self-service Business Intelligence system with BI features like data creation, automation, analysis, and visualisation. Clear Analytics also functions with Microsoft Power BI, cleaning and modelling various datasets with Power Query and Power Pivot.
12.Tableau: Needs No Introduction
Tableau is a powerful BI tool that specialises in data discovery and visualisation. The software allows to quickly analyse, visualise, and share data without IT intervention. Tableau works with various data sources, including Microsoft Excel, Oracle, MS SQL, Google Analytics, and SalesForce. Users will have access to well-designed, user-friendly dashboards. Tableau also provides several products, such as Tableau Desktop (for anyone) and Tableau Server (analytics for organisations), both of which can be run locally, as well as Tableau Online (hosted analytics for organisations) and others.
13.Oracle BI: Proactive Intelligence Power
Oracle BI is a business intelligence technology and application portfolio for enterprises. This technology provides nearly all business intelligence capabilities, including dashboards, proactive intelligence, ad hoc reporting, etc. Oracle is a reliable choice ideal for businesses that need to analyse large amounts of data from Oracle and non-Oracle sources. Data archiving, versioning, a self-service portal, and alerts/notifications are also essential features.
14.Domo: Predictive Analysis on the Go
Domo is a fully cloud-based business intelligence platform that integrates spreadsheets, databases, and social media data. The platform provides visibility and analysis at the micro and macro levels, including predictive analysis powered by Mr Roboto, their AI engine. From cash balances and lists of your best-selling products by region to marketing ROI calculations for each channel, Domo has got you covered.
15.IBM Cognos Analytics: Hidden Patterns in Data Discovered
Cognos Analytics is a business intelligence platform powered by AI that supports the entire analytics cycle. It helps to visualise, analyse, and share actionable insights, from data discovery to data operationalisation. The data is interpreted and presented in a visually appealing report, and AI allows the discovery of hidden patterns in the data.
The use of advanced business intelligence reporting tools makes tasks simple and manageable. Business intelligence platforms are subject to change based on business needs and the advancement of technologies. Still, they have proven to be a great way to accomplish strategic goals effectively and efficiently.

In the evening, we had a wild-theme based gala party, and all got dressed up in sync with the theme, ‘Just Go Wild’. It was fun to watch everyone from the Manager to the employees dressed up in the same theme. We had an exhilarating DJ party manned by Darryl Gaulbert which made us all shake a leg to the tune. We danced and roared to the music. It was indeed wild!
The following day after breakfast, we met our founder Indumon Das, who had a chat with us regarding the journey of Beinex and his vision. It inspired us all to have a dream and pursue it fearlessly. Some of us accessed the infinity pool late afternoon and had great fun swimming and playing pool ball.
It was a blissful evening based on an ethnic wear theme. We competed for the best ethnic outfit of the evening. The different hues and styles made the evening stunning. Everyone flaunted the traditional wear in style. We had a musical evening with a live barbeque and a sumptuous dinner.
Finally, the day of leaving Munnar dawned; March 19. We all had breakfast in the morning and packed our backpacks. Most of us were pretty reluctant to leave Munnar as we were not ready to lose the bond we created together. Nonetheless, we vowed to stay connected. We boarded the buses around 10 AM and waved goodbye to Munnar.
When we reached Edapally in the evening, a surprise goody bag was waiting. It was an impressive and admirable gesture from our firm. Beinex has a culture of nurturing growth and spreading positivity, and employees’ comfort is the priority here.
Yes, we had a fantastic time together. After this retreat, our rejuvenated and motivated minds are ready to bounce back to work with enhanced spirit. We are looking forward to more team building sessions in the future to meet each other more often.What is an SLM?
A Small Language Model (SLM) is tailored to excel in simpler tasks, offering boosted accessibility and user-friendliness for organizations operating with limited resources. Besides, they can be readily fine-tuned to align with specific requirements. Small language models are particularly well-suited for organizations aiming to develop applications capable of operating local devices instead of relying on cloud infrastructure. They are especially beneficial for tasks that do not necessitate extensive reasoning or immediate responses.
Reasons to use SLMs
Given the growing popularity and applicability of SLMs across various domains, particularly in areas like sustainability and the volume of data required for training, there are multiple reasons for employing them.
What is Phi-3?
Microsoft has a suite of small language models (SLMs) known as 'Phi,' demonstrating outstanding performance across various benchmarks. Microsoft's recent release is Phi-3, a series of open AI models. The Phi-3 models represent a prototype of capability and cost-effectiveness among small language models (SLMs), exceeding models of equivalent and larger sizes across the spectrum of coding, language, reasoning, and mathematical standards. This launch broadens the array of high-calibre models accessible to customers, providing them with more practical options as they craft and construct generative AI applications.
Phi-3-mini, a 3.8B language model, is accessible through Microsoft Azure AI Studio, Hugging Face, and Ollama. It is offered in two context-length variations—4K and 128K tokens. Notably, it is the first model within its category to support a context window of up to 128K tokens with minimal impact on quality. Furthermore, it is instruction-tuned, implying that it has been trained to comprehend and adhere to diverse instructions, mirroring natural human communication patterns. This ensures that the model is readily deployable straight out of the box. Phi-3-mini is available on Azure AI to leverage the deploy-eval-finetune toolchain, and it is also accessible on Ollama for developers to execute locally on their laptops.
Features of Phi-3
Phi-3 models exhibit distinctive superiority over language models of comparable and larger dimensions on key benchmarks, showcasing the following features:
Snowflake meets Phi-3: Advantages
The key pain point about LLMs is the computing required to host and run them. Setting up a dozen GPUs to run models can be expensive and complex. There's where Snowflake steps up. Snowflake's compute pool option enables users to easily and quickly set up and manage compute clusters. Phi-3 comes into the picture because of its cost-effective GPU utilization.
Can you imagine a situation where your language model only requires less than 3GB of GPU memory for inference? Well, now it's possible, all thanks to Phi-3. It's a state-of-the-art SLM that produces excellent results over GP3.5 and Mistral 8x7B, which are much bigger models. This opens the door for more cost-effective solutions to be brought up in the AI space. Add Snowflake for hosting; you have an excellent setup to host, test, and build AI applications. Read below how Beinex managed to run Phi-3 on Day 0 in Snowflake.
Figure 1: DocAI running on Phi-3
Implementing Phi-3 on Snowflake: What Beinex Did and How Beinex Did it?
Beinex has seamlessly integrated Phi-3 into Snowflake to help enterprises unlock their data's full potential through advanced language processing capabilities and enhance decision-making with deeper insights. The integration facilitates Snowflake users to:
Here's a detailed guide on implementing Phi-3 on Snowflake:
Step 1: Create Necessary Objects
-- Run by ACCOUNTADMIN to allow connecting to Hugging Face to download the model
-- Stage to store LLM models
CREATE STAGE <stagename> IF NOT EXISTS models
DIRECTORY = (ENABLE = TRUE)
ENCRYPTION = (TYPE='SNOWFLAKE_SSE');
-- Stage to store YAML specs
CREATE STAGE <stagename> IF NOT EXISTS specs
DIRECTORY = (ENABLE = TRUE)
ENCRYPTION = (TYPE='SNOWFLAKE_SSE');
-- Image repository
CREATE OR REPLACE IMAGE REPOSITORY images;
-- Compute pool to run containers
CREATE COMPUTE POOL GPU_NV_S
MIN_NODES = 1
MAX_NODES = 1
INSTANCE_FAMILY = GPU_NV_S;
Step 2: Docker Image Code - ollama
FROM ollama/ollama
RUN $(ollama serve > output.log 2>&1 &) && sleep 10 && ollama pull phi3 && pkill ollama && rm output.log
ENTRYPOINT ["ollama"]
CMD ["serve"]
Step 3: Tag and Push the Docker Image
docker tag ollama <SNOW_ORG-SNOW_ACCOUNT>.registry.snowflakecomputing.com/db/schema/image respository /ollama
docker push <SNOW_ORG-SNOW_ACCOUNT>.registry.snowflakecomputing.com db/schema/image repository /ollama
Step 4: Docker Image - UDF
FROM python:3.11
WORKDIR /app
ADD ./requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
ADD ./ /app
EXPOSE 5000
ENV FLASK_APP=app
CMD ["flask", "run", "--host=0.0.0.0"]
App.py content is given below :
from flask import Flask, request, Response, jsonify
import logging
import re
import os
from openai import OpenAI
client = OpenAI(
base_url='http://ollama:11434/v1',
api_key="EMPTY",
)
model = "phi3"
app = Flask(__name__)
app.logger.setLevel(logging.ERROR)
def extract_json_from_string(s):
logging.info(f"Extracting JSON from string: {s}")
# Use a regular expression to find a JSON-like string
matches = re.findall(r"\{[^{}]*\}", s)
if matches:
# Return the first match (assuming there's only one JSON object embedded)
return matches[0]
# Return the original string if no JSON object is found
return s
@app.route("/", methods=["POST"])
def udf():
try:
request_data: dict = request.get_json(force=True) # type: ignore
return_data = []
for index, col1 in request_data["data"]:
completion = client.chat.completions.create(
model=model,
messages=[
{
"role": "system",
"content": "You are a bot to help extract data and should give professional responses",
},
{"role": "user", "content": col1},
],
)
return_data.append(
[index, extract_json_from_string(completion.choices[0].message.content)]
)
return jsonify({"data": return_data})
except Exception as e:
app.logger.exception(e)
return jsonify(str(e)), 500
Step 6: YAML File
spec:
containers:
- name: ollama
image: <SNOW_ORG-SNOW_ACCOUNT>.registry.snowflakecomputing.com/ db/schema/image respository /Phi3
resources:
requests:
nvidia.com/gpu: 1
limits:
nvidia.com/gpu: 1
env:
NUM_GPU: 1
MAX_GPU_MEMORY: 24Gib
volumeMounts:
- name: llm-workspace
mountPath: /<stage name>
- name: udf
image: <SNOW_ORG-SNOW_ACCOUNT>.registry.snowflakecomputing.com/ db/schema/image respository /ollama_udf
endpoints:
- name: chat
port: 5000
public: false
- name: llm
port: 11434
public: false
volumes:
- name: llm-workspace
source: "@<llm stage_name>"
Step 7: Upload YAML File and Create Service
Upload the YAML file to the created stage, where the stage name in the YAML file should match the stage created in Step 2.
-- Create service
create service phi3
IN COMPUTE POOL <name of compute pool created>
FROM @dash_stage
SPECIFICATION_FILE = '<name of yaml file uploaded>';
Step 8: Create Service Function
Create a service function on the service (after it starts).
create or replace function phi3chat(prompt text)
returns text
service= phi3
endpoint=chat;
Check Service Status
Use the following command to check the status of the service:
SELECT
v.value:containerName::varchar container_name,
v.value:status::varchar status,
v.value:message::varchar message
FROM (
SELECT parse_json(system$get_service_status('<service name>'))
) t,
LATERAL FLATTEN(input => t.$1) v;
Benefits of Running Phi-3 on Snowflake
1. Cost-Effectiveness and Efficiency:
2. Compatibility with Smaller GPUs:
3. Exceptional Performance:
4. Faster Response Times:
SLM vs LLM
The choice between small and large language models hinges on organizational needs, task complexity, and resource availability.
LLMs excel in applications requiring the orchestration of intricate tasks, encompassing advanced reasoning, data analysis, and contextual comprehension.
On the other hand, SLMs present viable options for regulated industries and sectors facing scenarios necessitating top-tier results while maintaining data within their premises.
Both large and small language models possess distinct strengths and applications. While large language models thrive in managing complex workflows, small language models deliver impressive performance despite their compact size.
While some customers may exclusively require small models, others may favour larger models, with many seeking to integrate both types in various configurations. Ultimately, the optimal selection depends on the unique context and objectives of the organization. Besides transitioning from large to small models, the trend is evolving towards a diversified portfolio of models. This means that instead of relying on a single model, customers can choose from various models with different sizes, capabilities, and resource requirements. This empowers customers to decide the best model for their scenario, balancing performance and resource constraints.