Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i have
coloumn 1 having Yes,No
coloumn 2 having 100
coloumn 3 having 50
my req is
if(coloumn1='Yes',max(fabs(coloumn(2)+3*coloumn(3)),fabs(coloumn(2)-3*coloumn(3))
i have used because i have negative values in my data
i want get when coloumn 1 is Yes then max(coloumn(2)+3*coloumn(3)),fabs(coloumn(2)-3*coloumn(3)))
ex: max(100+3*50,100-3*50) = max(250,50) it should return 250 for Yes
it means for yes only i want see data
if it is no then i want get blank space
how to write a condition for this
Hi,
In your graph, use coloumn 1 as a dimension and the expression will be:
if(coloumn1='Yes',RangeMax(fabs(coloumn(2)+3*coloumn(3)),fabs(coloumn(2)-3*coloumn(3)))
Hi CommonQlik,
where do you want to do this calculation?
In the script or on the GUI?
I would guess in the script - that would be better, performance-wise, and as the calculation depends on a column in the table, it won't be changed by the user.
Then write it, pretty much like you have it,
>> IF([column1] = 'YES', max([column2] + (3*[column3])), max([column2] - (3*[column3])) <<
Just keep in mind that in the script, since you use the aggregation_function max(), you need a GROUP BY clause to encompass all other fields in the LOAD - so if there are fields that you don't want to build groups on, you will have to leave those aside and join them to the outcome of this again.
HTH
Best regards,
DataNibbler
I WANT IN THE CHART LEVEL
Hi,
In your graph, use coloumn 1 as a dimension and the expression will be:
if(coloumn1='Yes',RangeMax(fabs(coloumn(2)+3*coloumn(3)),fabs(coloumn(2)-3*coloumn(3)))
Try the expression:
=if(Coloumn1='Yes',rangemax(fabs(Coloumn2+3*Coloumn3),fabs(Coloumn2-3*Coloumn3)),' ')
Where Coloumn1, Coloumn2, Column3 are Coloumn names in the table.
Ok
but it it is showing data for Column1= No also
is it showing the same results for no? or something like 0?
Not same result and not 0 giving some output like for yes
can u show a screenshot and paste the exact expression you use in your graph?
got it now it is showing values for only Yes
but if the value suppose to come 50.3 but i am getting 50.6 here