Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

How to replace L_move <= '01/01/2014' with Year_n<='5' ?

Hi All


Below expression work fine :-


=if([C_ONHAND_AMT]>1 and L_move <= '01/01/2014', [C_ONHAND_AMT])


I neee to replace 01/01/2014 to Year_n <= 5 , In Table 2 i using below expression :-


=if([C_ONHAND_AMT]>1 and Year_n <= 5, [C_ONHAND_AMT])

=if([C_ONHAND_AMT]>1 and Year_n <= '5', [C_ONHAND_AMT])

=if([C_ONHAND_AMT]>1 and Year_n <= "5", [C_ONHAND_AMT])


it does not work , Hope some one can advise me.


I expect to make table 1 and 2 same total amount.


Paul Yeo



9 Replies
paulyeo11
Valued Contributor II

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

My QVW

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

May be use this measure and don't call Calc. Field instead use Direct field

Sum({<PRODUCT_CODE_INV = {"=(Sum(C_ONHAND_AMT)>1 and L_move <= '01/01/2014')"}>} C_ONHAND_AMT)

paulyeo11
Valued Contributor II

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

Hi Anil

I think i never explain to you why i want to using Year_n , so that i don't need maintenance.  it is possible to help me with the Year_n ?

Paul

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

What u want help from here?

year(today()) - year(@180:190T) + 1                                   as Year_n,

paulyeo11
Valued Contributor II

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

Hi Anil

=if([C_ONHAND_AMT]>1 and Year_n <= 5, [C_ONHAND_AMT])

=if([C_ONHAND_AMT]>1 and Year_n <= '5', [C_ONHAND_AMT])

=if([C_ONHAND_AMT]>1 and Year_n <= "5", [C_ONHAND_AMT])


My question is how to make the above expression work ?


Paul

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

What you showed is working one only. Instead 3 rd one 1st, 2nd should work? Aren't you?

paulyeo11
Valued Contributor II

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

Hi Anil

I just check , all 3 expression not working.

Paul

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

What about this?

=if([C_ONHAND_AMT]>1 and Year_n <= 5, Sum([C_ONHAND_AMT]))

paulyeo11
Valued Contributor II

Re: How to replace L_move <= '01/01/2014' with Year_n<='5' ?

Hi Anil

Still not display any thing on the table.

if the expression work fine , in future i don't need to maintenance this expression, as it will display those stock items after purchase for more then 4 year , not yet selling.

Paul

Community Browser