Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

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
Master
Master
Author

My QVW

Anil_Babu_Samineni

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)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

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

Anil_Babu_Samineni

What u want help from here?

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

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

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

I just check , all 3 expression not working.

Paul

Anil_Babu_Samineni

What about this?

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

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