Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have t1, t2 columns.. . these 2 fields having null values
i would like to subtract these two t1-t2
when am doing in table level its working fine as if(alt(t1,0)-(alt(t2,0))<> 0 ,'NO','same')
but same thing is not working in script level.. how can i handle above expression in script level. i would like to show like above if t1,t2 values are equals i should treat this as 'same' else 'different'.
please help me
In the script you would have to create a field to store the result of the comparison.
LOAD
t1,
t2,
if(alt(t1,0)-(alt(t2,0))<> 0 ,'NO','same') as FieldNameHere
FROM ...
i tried same thing.
but same logic is not working properly
TRY THIS
if(if(isnull(t1),0,t1)-if(isnull(t2),0,t2) <>0,'NO','SAME') as [FIELD NAME]
Can you attach sample qvw
LOAD
t1,
t2,
if(if(isnull(t1),0,t1)-if(isnull(t2),0,t2) <>0,'NO','SAME') as [FIELD NAME]
FROM ...
Perhaps your data contains text values or strings of spaces so the t1 and t2 columns are interpreted as text instead of as numbers. Try using the num() function: if(alt(num(t1),0)-alt(num(t2),0),'NO','same')
I think the nulls you are having are due to how the data you are showing in front end (my guess: straight table) over dimensions.
The fields u are using in the chart are coming from one single QV table?
if not you need to replicate the same logic as in front end in the script too and then use the expression given by other members