Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Amita
Contributor II
Contributor II

If condition not working correctly for all data in data load editor

In data load editor while loading data created calculated column with if condition. It is a bulk data. When condition is executing for similar data some are satisfied and some are moving in default else condition. For some rows of data it is working properly.

is this a Qlik issue or need to change something in data load editor?

Labels (2)
2 Solutions

Accepted Solutions
MarcoWedel

Your expression does not reproduce this behaviour loading your sample data, so I guess the issue lies rather with your qvd data.

MarcoWedel_0-1647286640339.png

 

table1:
LOAD
	[A],
	[B],
	[C],
	[D],
	[E],
    If(B >= C and C <= D,'No Issues',
    If(C > B and C <= D,'Req S',
    If(B = D and C > D,'Req C',
    If(B < D and C > D,'S+C','Others')))) as STATUS
 FROM [lib://DataFiles/Qlik_Com_Sample_DATA.xlsx] (ooxml, embedded labels, table is Sheet2);

View solution in original post

Amita
Contributor II
Contributor II
Author

I have resolved the issue by change varchar to num in Load statement. Now it is satisfying condition properly .

Thank you.

View solution in original post

5 Replies
anat
Master
Master

if possible can u share the if logic what u r using- with some sample data

Amita
Contributor II
Contributor II
Author

Hi Anat,  My if logic is like:

 

LOAD
[A],
[B],
[C],
[D],
[E],
[F] ,
if(B >= C and C <= D,'No Issues',
if(C > B and C <= D,'Req S',
if(B = D and C > D,'Req C',
if(B < D and C > D,'S+C','Others')))) as STATUS,
if(C > B ,'E') as HEADLINE

FROM [lib://QVD/xyz.qvd](qvd)
where not isnull(XDate) ;

 

And attached  sample data with STATUS column calculated . You can remove that run the logic.

1st row is satisfying condition "No issues" but still going in others.

I want to create a donut chart so for dimension i am creating a column STATUS in data load editor.

Thanks in Advance.

MarcoWedel

Your expression does not reproduce this behaviour loading your sample data, so I guess the issue lies rather with your qvd data.

MarcoWedel_0-1647286640339.png

 

table1:
LOAD
	[A],
	[B],
	[C],
	[D],
	[E],
    If(B >= C and C <= D,'No Issues',
    If(C > B and C <= D,'Req S',
    If(B = D and C > D,'Req C',
    If(B < D and C > D,'S+C','Others')))) as STATUS
 FROM [lib://DataFiles/Qlik_Com_Sample_DATA.xlsx] (ooxml, embedded labels, table is Sheet2);
Amita
Contributor II
Contributor II
Author

Thanks Marcowedel.

How we can verify QVD data. Because the sample data i have shared fetched from app only(QVD).

In DB one column is varchar and others are number. Because of varchar column QVD is behaving like this. For some rows it is satisfying condition and some for some rows not working? 

Amita
Contributor II
Contributor II
Author

I have resolved the issue by change varchar to num in Load statement. Now it is satisfying condition properly .

Thank you.