Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to QlikView and I am trying to add a three way condition to a chart expression definition. I would normally do this with a if,then,else. Either that is not allowed in the definition or I can't seem to get the syntax down. Here is the code that I currently have for 2 conditions.
IF ((SLA_RECORD_SORT = '0001' OR SLA_RECORD_SORT = '0002' OR SLA_RECORD_SORT = '0003' OR SLA_RECORD_SORT = '0004')
AND (SLA_LINE='196' OR SLA_LINE='197' OR SLA_LINE='199' OR SLA_LINE='200' OR SLA_LINE='201' OR SLA_LINE='203'
OR SLA_LINE='205'OR SLA_LINE='209' OR SLA_LINE='230')
,Round(Sum (SLA_MTH_TON_00004)),ROUND (Sum (SLA_MTH_TON_00004),.1))
This works fine. If the condition is true it formats the output to the nearest whole number, If it is false it formats the number to 1 decimal which is what I want. The reason for this is because we sell some stuff in cases which are whole numbers and some stuff in tons which need to be carried out to one place to the right of the decimal. The problem is i need to add a format for 2 places to the right of the decimal. In pseudo code I would think it would look something like.
If condition1 then format1
Elseif condition2 then format2
Else format3
Any help or ideas would be appreciated.
You can use nesteds if´s
if( cond1, format1, if(cond2, format2, format3))
That did it. Many thanks!
Jim just a sugestion....
i think is really better if you use a set analisys.....more perfomance and more easy to group two IF´s!!!!
set analisys expr....
ROUND(Sum ( {$<SLA_RECORD_SORT={'0001','0002','0003','0004'},SLA_LINE={'196','197','199','200','201','203','205','209','230'}>} SLA_MTH_TON_00004),.1)