Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Need to check condition like
If (Id = ( If(Id=1,vid) + 1 ), 'true','false')
For example : If(Id=1,vid) gives value 1, then add 1 to it which is 2
So given expression works like
If(Id=2,'true','false')
But it is not working. Is there any other solution or need to correct syntax?
Please Help!
Thanks
Sheela
What is the context of your chart expression? A dimension Id?
I assume this has something to do with your other post, where you pass a value for Id and you need a static retrieval vid:
Create a variable vVid in variable overview:
=Only({1<Id = {$(vIdSetDuringLOAD)}>} vid) //Check if Only is appropriate or if you need another aggregation
Check that this returns the proper result, e.g. in a text box.
In your table chart, you can then use
=If(Id = Rangesum(vVid,1), Name)
But as with your other post, a real working sample QVW and expected results would make help much easier...
Can you please share more details what exactly you want to do? As from the details of your question i can see you want to have the calculation to return false always. There will not be a regular case of true at all.
Hi Sumit,
I want check condition exactly like
If (Id = ( If(Id=1,vid) + 1 ), Name)
Inner if condition value + 1 and need to compare with Outer Id , if it is true ,display name else not.
Like
If (Id = ( If(Id=1,vid) + 1 ), Name)
If (Id = ( 1 + 1 ), Name)
If (Id =2 , Name)
Thanks
Sheela
Where are you doing this? How can a single row have Id = 1 and Id = 2 at the same time? Can you provide a sample to look at?
Hi sunny,
I am writing this in ' Expression' mode of Straight table.
Sorry, it is like
If (Id = ( If(Id1=1,vid) + 1 ), Name)
Thanks
Sheela
Would you be able to provide a sample?
Preparing examples for Upload - Reduction and Data Scrambling
The + operator doesn't really like adding to NULL. So whenever your inner IF evaluates to false, it will cause NULL (your implicit else value) to be added to 1, which results in NULL again... And logical expressions cannot use the = operator to compare to NULL.
Use Rangesum() to avoid a calculation from returning a NULL value. Like in
IF (Id = (RangeSum(IF(Id1 = 1, vid), 1)), Name)
The RangeSum expression will always return either vid+1 or 1.
And make sure that for every evaluation of this expression, both Id and Id1 referrals return exactly one value. Or you will again be comparing to NULL.
Hi Peter,
Thanks for your reply!
IF (Id = (RangeSum(IF(Id1 = 1, vid), 1)), Name)
This expression meets the requirement, but it is not returning anything.Please Help.
Thanks
Sheela
Can you share few rows of data?