Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anil_Babu_Samineni

Odd & Even Problem

Hello Friends,

Can anyone help me here.

I have

Name     Sales    

A               10

B               11

C               20

D               30

I've created straight table, But i want to add one more column which odd & Even numbers

10 - Even - True

11 - Odd - False

I tried this expression

if(Sum(Sales),(odd(Sum(Sales))), 'False',(even(Sum(Sales))), 'True')

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
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this: =if(Odd(sum(Sales)),'Odd',If(Even(Sum(Sales)),'Even'))


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
Gysbert_Wassenaar

Try this: =if(Odd(sum(Sales)),'Odd',If(Even(Sum(Sales)),'Even'))


talk is cheap, supply exceeds demand
effinty2112
Master
Master

Hi Anil,

          Try

Pick(Mod(Sum(Sales),2)+1,'Even','Odd')

Cheers

Andrew

Anil_Babu_Samineni
Author

Yes, It is working. But, i want to give Color also like if Odd - Green() & Even - Blue()

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
Gysbert_Wassenaar

Click on the + in front of the expression, select BackGround color and use this expression as Definition:

=if(Odd(sum(Sales)),Green(),If(Even(Sum(Sales)),Blue()))


talk is cheap, supply exceeds demand
effinty2112
Master
Master

Hi,

Pick(Mod(Sum(Sales),2)+1,Blue(),Green())

Anil_Babu_Samineni
Author

Nice to see, It's working.

Both expressions are working, But first response is Gysbert. That's why i put the flag his Answer.

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

If you're not fast you're last!!!

all the best

Andrew

Anil_Babu_Samineni
Author

Not like that Andrew, I appreciate your nature helping for freshers. That's why we choose the Qlikview

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
Not applicable

Hi Anil,

please find the qvw attached.

Thanks.