Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I need help in below logic.
I'm having shift wise stacked bar chart which is showing "Pieces Produced" across 3 shifts , like below:
Dim : 1. Date
2. Shift_Name
Expression:
Pieces Produced : =num(Count(DISTINCT Serial))
Now I have to calculate "Total Pieces Produced " and the logic for this should be :
TOTAL PIECES PRODUCED = Above Calculation of Pieces Produced + [NO CAQ SCRAP FLAG]
So condition for [NO CAQ SCRAP FLAG] is vNScrapFlag =SUM( {$<Type_Name = {'Scrap'},Production = {'NoCAQ'}>} Quantity)
I'm trying below expression to achieve Total Pieces , but it not working as expected :
=num(Count(DISTINCT Serial)) + vNScrapFlag
See below:
As you can see above in Scrap Produced graph , we are having count "2" in Spat shift and "16" in Nacht Shift , so in bar chart of Total Pieces Produced it should add 2 to 243 Spat shift and 16 to 302 Nacht Shift.
By using =num(Count(DISTINCT Serial)) + vNScrapFlag , it is adding "18" to all the shifts which is wrong. The correct Output should be as marked in yellow circle.
I hope I'n clear here!
Please suggest how I can achieve this.
Attached is demo qvw.
Thanks,
AS
Hi Anil,
Thank you!
I will try this also and update you.
But I got the solution by using below expression:
num(Count(DISTINCT Serial)) + SUM({$<Type_Name = {"Scrap"}>} Quantity) -SUM( {$<Type_Name = {'Scrap'},Production = {'CAQ'}>} Quantity)
Thanks,
AS
Any Suggestions???
Thanks,
AS
Are you expecting changes over here - Total Pieces Produced stacked by shift ??
Yes Anil.
Thanks,
AS
Hi,
The shared qvw file shows the same result as you want?
Please help me understand what exactly you need.
Regards,
Kaushik Solanki
Is this you are expecting
I have removed Shift_Name and i added
Calc. Dimension:
=ValueList('Früh','Nacht','Spät')
Expression:
If(ValueList('Früh','Nacht','Spät') = 'Nacht',num(SUM( {$<Shift_Name = {'Nacht'}, Type_Name = {'Scrap'}>} Quantity)), If(ValueList('Früh','Nacht','Spät') = 'Spät',
num(SUM( {$<Type_Name = {'Scrap'}, Shift_Name = {'Spät'}>} Quantity)),
If(ValueList('Früh','Nacht','Spät') = 'Früh',num(Count(DISTINCT {<Shift_Name = {'Früh'}>} Serial)))))
Hi Anil,
Thank you!
I will try this also and update you.
But I got the solution by using below expression:
num(Count(DISTINCT Serial)) + SUM({$<Type_Name = {"Scrap"}>} Quantity) -SUM( {$<Type_Name = {'Scrap'},Production = {'CAQ'}>} Quantity)
Thanks,
AS
Good, And this expression gives me this. Is this you are expecting??
Yes Anil!
Thanks,
AS
Haha, I thought that is x not the + . Anyway, Thanks for coming back