Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Raja_9513
Contributor
Contributor

How to show one values

Hi,

Below is my issue, i have sample data in that same Product has done sales in two stores that is store A and Store B,

My requirement is

*if product has sold in two Store(A&B) i have to show only store A sales only 

*If  Product has sold in Store A it has to take Store A sales only 

* if product has sold in Store B it has to take store B sales only.

How to achieve this 

 

Labels (1)
1 Solution

Accepted Solutions
PrashantSangle

use aggr() to get correct sum at total level, 

Try below

Sum(aggr(if (DataSource = 'T_Fact_Food_Delivery_Check',
Sum({<DataSource={'T_Fact_Food_Delivery_Check'}>}[Net Sales Amt]),
Sum({<DataSource={'Fact_Check_Summary_DayPart'}>}[Net Sales Amt])),your_dimension_field))

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

5 Replies
Saravanan_Desingh

Try this,

tab1:
LOAD * INLINE [
    Store, Product, Sale
    A, P1, 10
    B, P1, 20
    A, P2, 30
    B, P3, 40
];
Saravanan_Desingh

In the Chart:

commQV19.PNG

Raja_9513
Contributor
Contributor
Author

Hi Saran,

Thanks for response,

actually i have attached senior screenshot i have created two pivot tables one is dimensions second table is fact information, as i have told above requirement i have to show only one value if same product have two sales information i have used mentioned formula it showing fine but when it is coming to total it is not  correct, please suggest me if as i am doing any thing wrong 

Formula :- if (DataSource = 'T_Fact_Food_Delivery_Check',
Sum({<DataSource={'T_Fact_Food_Delivery_Check'}>}[Net Sales Amt]),
Sum({<DataSource={'Fact_Check_Summary_DayPart'}>}[Net Sales Amt]))
 

PrashantSangle

use aggr() to get correct sum at total level, 

Try below

Sum(aggr(if (DataSource = 'T_Fact_Food_Delivery_Check',
Sum({<DataSource={'T_Fact_Food_Delivery_Check'}>}[Net Sales Amt]),
Sum({<DataSource={'Fact_Check_Summary_DayPart'}>}[Net Sales Amt])),your_dimension_field))

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

or try below

sum(aggr(Min([Net Sales Amt]),DataSource,delivery_provider,restarunt_num))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂