Hellow again i manage to solve one proble but now same problem pop ap again i hope this time ith my new expirence i can explain it better so i can get help
so i have a quri that take one line in table and if it math the condition in my situation is if
Date and Tracking_Category_1 in table OLAP.VW_CUBE_Finance
eqval Date and Tracking_Category_1 in OLAP.test2
then it take line that have both condition and brake it in 3 more and divide amount that was in original line bitwin new ones
amountd is total amount spread bitvit new lines
my quri for that look like this
A1.Tracking_Category_1,
case
when A1.Month = CAST(b2.date AS DATE)
and a1.Tracking_Category_1 = AllocateFromTc
then AllocateToTc
else a1.Tracking_Category_1
end as Tracking_Category_d,
A1.TEXT_VAL,
case
when A1.Tracking_Category_1 = AllocateFromTc
and A1.Month = CAST(b2.date AS DATE)
then A1.Amount*[Percent]/100
else A1.Amount
end as Amountd
,A1.Amount
from OLAP.VW_CUBE_Finance_NAMES A1 , OLAP.Test B2
data in olap test look like this
so my problem is that in my final resolt i dont need to see the line that
is braking apart i will color it red i need to se only yelow
but i still se red one
i tryed to to used where to filter a resolt but there i ahve a problem to i have another data that dont need to be modifire outside of A1.Month = CAST(b2.date AS DATE)
and i cant efferct Tracking_Category_d becouse its just created in side of this quri
so how can i modifire my quri so i am is goint to get only yelow resolt and evrything out of it but not red
so far my final curi look like this
A1.Tracking_Category_1,
case
when A1.Month = CAST(b2.date AS DATE)
and a1.Tracking_Category_1 = AllocateFromTc
then AllocateToTc
else Tracking_Category_1
end as Tracking_Category_d,
A1.TEXT_VAL,
case
when A1.Tracking_Category_1 = AllocateFromTc
and A1.Month = CAST(b2.date AS DATE)
then A1.Amount*[Percent]/100
else A1.Amount
end as Amountd
,A1.Amount
from OLAP.VW_CUBE_Finance_NAMES A1 , OLAP.test2 b2
where A1.Month = CAST(b2.date AS DATE)
union
A1.Tracking_Category_1,
case
when A1.Month = CAST(b2.date AS DATE)
and a1.Tracking_Category_1 = AllocateFromTc
then AllocateToTc
else a1.Tracking_Category_1
end as Tracking_Category_d,
A1.TEXT_VAL,
case
when A1.Tracking_Category_1 = AllocateFromTc
and A1.Month = CAST(b2.date AS DATE)
then A1.Amount*[Percent]/100
else A1.Amount
end as Amountd
,A1.Amount
from OLAP.VW_CUBE_Finance_NAMES A1 , OLAP.Test B2
where A1.Month <> CAST(b2.date AS DATE)