Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue on if condition

HI

if( 1.1 smaple or 1.2 sample or 1.3 sample or 1.4 sample or 1.5 sample or 1.6 sample or 1.7..........2.9 ='on track','G',

if( 1.1 Review or 1.2 Review or 1.3 Review or 1.4 Review or 1.5 Review or 1.6 Review or 1.7..........2.9 ='Hold','Y',

if( 1.1 regin or 1.2 regin or 1.3 regin or 1.4 regin or 1.5 regin or 1.6 regin or 1.7..........2.9 ='Progress','B',)))

like above i need to write 10 more lines like that please correct me on my if condition

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Not sure why you don't want to use CrossTable, but see this is what i get using crosstable load

Capture.PNG

View solution in original post

8 Replies
ziadm
Specialist
Specialist

The syntax should be

if( [1.1 smaple] ='on track' or [1.2 sample] ='on track'  ...........,'G',if())

This is a lengthy if condition and could be written in a better if you share a sample data

Not applicable
Author

i tried like that but still showing wrong results

ziadm
Specialist
Specialist

Please share a sample data .. There are many better ways than if statement and more efficient

Not applicable
Author

hi

please find my Sample docs

if( 1.1 smaple or 1.2 sample or 1.3 sample or 1.4 sample or 1.5 sample or 1.6 sample or 1.7..........2.9 ='on track','G',

if( 1.1 Review or 1.2 Review or 1.3 Review or 1.4 Review or 1.5 Review or 1.6 Review or 1.7..........2.9 ='Hold','Y',

if( 1.1 regin or 1.2 regin or 1.3 regin or 1.4 regin or 1.5 regin or 1.6 regin or 1.7..........2.9 ='Progress','B',))

sunny_talwar

What are you trying to achieve?

Not applicable
Author

According to my sample data my output shown in image

if( 1.1 smaple or 1.2 sample or 1.3 sample or 1.4 sample or 1.5 sample or 1.6 sample ='on track','G',

if( 1.1 Review or 1.2 Review or 1.3 Review or 1.4 Review or 1.5 Review or 1.6 Review ='Hold','Y',

if( 1.1 regin or 1.2 regin or 1.3 regin or 1.4 regin or 1.5 regin or 1.6 regin ='Progress','R',))

Thanks,

sunny_talwar

Not sure why you don't want to use CrossTable, but see this is what i get using crosstable load

Capture.PNG

varshavig12
Specialist
Specialist

Is this okay ?

Expression for 1.1 Sample: 

=if([1.1 Sample]='on track','G',

if([1.1 Sample]='on Hold','Y',

if([1.1 Sample]='Progress','R')))

PS: I still think Cross table is a better option as suggested by stalwar1